[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] GUI for pygame : ThorPy



Hi Yann,

I made one, too, a couple of years ago.ÂHere it is:Âhttp://www.burtonsys.com/download/DavesGUI.zip

It sounds like yours is probably more complete than mine, but if there's anything in mine which is useful to you, please feel free to plagiarize (per the notice in the comment block at the top of the main source file).

The documentation is weak, though it does work with pydoc, and there are a lot of comments in the source code. The "demo" starts at line number 2730.

To demo it, just unzip the files into a folder, and runÂDavesGUI.py Â-- then drag things around, click them, etc.

(DavesGUIdemo1.py also runs, but it's an older & weaker demo; I just included it so that you can see an example of the "import" statements.)

Prerequisites are Python 3.1 or later, or Python 2.6 or later 2.x, and pygame.

A design goal was to make it easily "drop in" to existing pygame games, using the existing games' existing event loops. GUIÂelements ("widgets") are subclassed fromÂpygame.sprite.Sprite,Âand user actions generate regular pygame events.

A widget is a sprite that can receive pygame events via its notify() method.ÂUnlike simpler sprites, some widgets can generate pygame events representingÂthings like button or menu clicks, entered text, etc.

Also, widgets can contain WidgetGroups of other widgets (as .children).

I didn't really finish it, but I implemented simple and 3D buttons, checkboxes, vertical menus, single-line text-entry boxes, modal and non-modal message boxes, vertical and horizontal scroll bars, and forms. Forms can contain other widgets, including other forms, and they can be nested to arbitrary depth. Overlapping widgets are handled properly, as are dragging and resizing.

As a favor to me, if you try it out or use it for anything, please take notes: a log of your frustrations, and what the documentation SHOULD HAVE told you, and what the code SHOULD HAVE done. As you accumulate such notes, please send them to me periodically.

Best regards,

Dave



On Wed, Jun 24, 2015 at 6:16 PM, Yann Thorimbert <Yann.Thorimbert@xxxxxxxx> wrote:
Hi all,

As many people did, I have been looking for a GUI for pygame. Naturally, I have found this page : http://www.pygame.org/tags/gui . However, 'GUI's there did not entirely fit my needs. I therefore wrote my own pygame GUI, ThorPy, that I would like to share with other people.

You can find it at http://www.thorpy.org. Any critics and remarks are welcome.

Also, I have another request : since I cannot sign up to pygame.org, could someone add my library website to the ones on http://www.pygame.org/tags/gui ? (I've been trying to subscribe to pygame.org for weeks, with no success :( ) Thanks!

Regards,

Yann Thorimbert