[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Minimal GUI support



On Fri, 25 Jan 2002, Magnus Lie Hetland wrote:

> I've been thinking about some small supporting tool for writing
> GUI-like code in PyGame -- especially adding "widgets" to plain PyGame
> applications (e.g. games), such as the buttons in SolarWolf etc.
>
> What I came up with was the FocusGroup (pardon the pun ;)
>
> Basically, it's a Group (I inherited RenderUpdates; perhaps I should inherit
> Group instead, and use it as a mixin?) which can manage links between its
> members, where each link has a test connected to it. This test is used to see
> whether a specific event warrants a focus change along that link. The elements
> should be sprites which implement the methods focus(), blur() and handle(). The
> code is quite simple (and I'm sure there is plenty of room for improvement):

I don't know what to think about this. I think pygame should stay quite
basic and minimal, just as SDL is. Widgets are such a complicated code
base that I would consider creating a new project.

Another thing is that if I did a game myself, I would want to make my own
set of widgets: games are extremely loose when it comes to this, and
that's part of the fun and the art: to program an application with no
boundaries and GUI guidelines, and let creativity render new and
revolutionary proposals. Just look at what modern GUIs are today: they
really seem to have taken some ideas from the gaming scene.

So, I advice you to work on a set of abstract classes that will save us
programmers from the typical boilerplate (like focus groups, events and
windows), but let none of that depend on any actual screen rendering, so
we can go ahead and do our own magic.

Greetings,
Arturo


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org