• Bluecat

    Bluecat - 2005-05-04

    Okay. I've taken the plunge and registered a project to fork the development of PyUI. It's called, rather imaginatively, PyUI2. (Or should I say unimaginatively?)

    I've already done a bunch of fixes and refactorings, and a couple of additions to the code, but I still have a little to do before I'm happy to check it in. I"ll probably get around to that this weekend. And I'll do a file release around the same time. It will be, however, version 0.1.

    Hope to see you there.

    • Michael Dorsett

      Michael Dorsett - 2005-05-04

      I've done some minor changes as well (some may have been duplicated already). Some examples are :

      How clipping works with listboxes (and some other text boxes). Although, in general I think the clipping needs to be totally redone for the entire project.
      Radio buttons
      Confirm Box
      Another type of Console Box
      Minimizable Frame
      Small Border Frame (no close/resizing - for static sized stuff)


      Anyways in the downloaded source, have a look in the pyui part. I used to keep the game and pyui seperate, but decided against it later.


      • Bluecat

        Bluecat - 2005-05-04

        Cool. I'll have a look. I was going to implement radio buttins and something similar to the small border frame myself, but haven't got to that yet. I did fix some clipping and some other widget drawing issues. In fact, here's the list of changes I've made so far:

        Changes since PyUI 1.0 Release

        PyUI2 0.1

        * Extracted classes from into individual files named for each class under a widgets subdirectory/package.
        * Extracted classes from into individual files named for each class under a layouts subdirectory/package.
        * Moved other widgets into the widgets directory.
        * Added OSXTheme in themes/ This is a copy of themes/
        * Added WinXPTheme in themes/ This is a copy of themes/
        * Added flags when creating frames.
          - NO_CAPTION stops the frame from displaying a caption bar.
          - NO_RESIZE creates a fixed size frame without a resizing area.
          - TOPMOST replaces the topmost parameter passed to the Frame constructor.

        * Added CaptionBar widget in widgets/
        * Removed Escape 'special event handler' from handleEvent in
        * Modified the update method in and to post a pyui2.locals.QUIT event, when a Pygame QUIT event is received. This fixes the issue where the app doesn't close when the application window is closed and it then hangs.
        * Searched through code base and corrected spelling of 'primative' to 'primitive.'

        In file
        * Added rendererBase and renderer3d imports to fix a crash

        In file renderers\
        * Added createFont method and removed old font creation from __init__ method. Now uses a pygame/sdl font object. If unable to load normally, will now use pygame.SysFont instead of Font(none) initially.
        * Modified getTextSize to return the size of the text using pygame/sdl font object.
        * Modified doDrawCommand to use the default font when rendering text.
        * Fixed a problem where title text was not displaying in the main window title bar. Added pygame.display.set_caption(title) in the __init__ method.

        In file
        * Added a new method called centerInDesktop, to the Frame class.
        * The caption bar is now a widget. Several methods added or modified to handle this.

        In file themes\
        * Added the drawDropDown method for drawing the dropDownBox widget.
        * Moved caption bar drawing from drawFrame to a new method called drawCaptionBar.
        * Modified drawFrame to actually draw a border.
        * Modifed the frameColor to gray.
        * Changed the color used for drawing the checkbox check from white to the defined foreground color since the white was really hard to see.
        * Changed the color used for drawing the background of the selected area in an edit field.
        * Fixed problem where text that was longer than the edit box was drawing over the end of the border.
        * If the edit is read only, it is no longer possible to select text and the caret no longer draws.

        In file themes\
        * Added a method called drawDropDown to draw the dropDownBox widget.

        In widgets\
        * Added the getPreferredSize and getMaximumSize methods.
        * Added a parameter to the constructor to create a checkbox already checked.

        In widgets\
        * Fixed up the draw function to properly render the drop box and selection list.
        * Modifed the constructor to initialise the widget with a list of items, the item to be selected, and to flag the widget as editable.
        * Added the getPreferredSize and getMaximumSize methods.
        * Adding an item to the DropDownBox no longer sets the selection to that item.

        Note that the XP and OSX themes are simple copies of the 2K theme. I still need to change them to suit.

        Most of these changes are within the context of the original PyUI design. As you say, some things (such as clipping) may need to be redesigned, and probably will be. I'll leave that to a later release though.

        • Jasper Phillips

          Jasper Phillips - 2005-05-05

          Sounds good.  I've got 60 changes to the last release of Pyui that I'll suggest and if you guys like migrate to Pyui2.  I haven't changed anything fundamental so it should go smoothly.

          I also have enhanced Frame and Button widgets, but they may be too specific to my game.  Then again, perhaps it would be nice to have more features.

          Once this is underway, it'd probably be a good idea to post about it to the pygame mail list as I suspect we're not the only ones who've been hacking PyUI.

          • Bluecat

            Bluecat - 2005-05-05

            That's excellent, I'd definitely like to have a look at those changes. Would it be too much to ask you to submit them as patches to the PyUI2 project? (The URL is\) I'd also like to take a look at your enhancements. I'm also of the opinion that it would be good to have more features. (Though not necessarily right away.)

            That's a good idea about posting to the pygame list. I was also thinking it might not be a bad idea to post to

            We should probably continue these discussions on the new forums now.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks