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

RE: [pygame] GUI



Vince Platt writes:
 > Well, this question is probably just more of the same then, but since
 > we're on the topic:  What chance is there that PyGame will be able to act
 > on a screen which is embedded on a Tk canvas?  

>snip<

I guess there are two options for directly integrating pygame with an
existing toolkit:

1) As you suggest, render into a widget. This should actually be
pretty easy; we can already use SDL in a GTK+ window (see
http://www.libsdl.org/projects/gtk-demo/index.html).
The disadvantage is as you say - it's only useful for windowed
applications, and only for window decorations (although the menu
functions would be pretty helpful).

2) Go at the problem from the other direction - make SDL a backend for
GTK or tk. Mark Baker mentioned some interest in this direction, but
he seems to have disappeared. This would be nontrivial, but would
allow us to use all the toolkit's resources in a pygame display. The
more I think about this, the less I like it - a programmer would have
to learn pygame, gtk and python/gtk just to display a simple command
button.

I think the best way to go would be to integrate one of the existing
SDL widget sets into pygame. There are already several to choose from,
they are already cross-platform and compatible with SDL. I know Jan
Eckholm was very keen on getting sdl_gui working with pySDL; working
with pygame should be even easier, owing to its modularity.

Sorry to ramble on. I'm going to go read up on the Rect class - I
think I have a crush on Rect.collidepoint :)

-- 
----------------------------------------------------------------
David "Futility [D!]" Clark  |  Everyone's gotta be something.
silenus@telus.net            |  Me, I'm garbage.
                             |  It's all I've ever wanted to be.
                             |  Shock me again, and I'll say
                             |  anything you want me to.   -MGB

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