osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: [pygame] pygame & gtk - msg#00107

List: python.pygame

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

Pawel J. Maczewski wrote:
Now, I got a lame question - is there any possibility to use a pygme
(sdl) window as a part of gtk window? to put the sdl window into the gtk
container?
there's a little voodoo to get it working, but many people have had no problems doing this with SDL and GTK in C. here's what it pretty much needs to by in pygame...



def embed_display(window_id):
"""initializes pygame into an embedded window.
must be called before any of pygame is initialized"""

#first, set the environment variables
os.environ['SDL_WINDOWID'] = str(window_id)
if sys.platform.startswith('win'): #disable directx
os.environ['SDL_VIDEODRIVER'] = 'windib'

#next, make it happen
pygame.init()
size = 100, 100 #doesn't really matter
return pygame.display.set_mode(size)


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


Thread at a glance:

Previous Message by Date:

[pygame] pygame & gtk

Hi, I'm new at this list, so I'd like to say "Hello" to everyone on the list ;) Now, I got a lame question - is there any possibility to use a pygme (sdl) window as a part of gtk window? to put the sdl window into the gtk container? regards, Pawel -- Pawel J. Maczewski @ HIL reg.linux user #281878 ____________________________________ pygame mailing list pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx http://pygame.seul.org

Next Message by Date:

Re: [pygame] pygame & gtk

Would something like this work with Tkinter? On Wed, 22 Jan 2003, Pete Shinners wrote: > Pawel J. Maczewski wrote: > > Now, I got a lame question - is there any possibility to use a pygme > > (sdl) window as a part of gtk window? to put the sdl window into the gtk > > container? > > there's a little voodoo to get it working, but many people have had no > problems doing this with SDL and GTK in C. here's what it pretty much > needs to by in pygame... > > > > def embed_display(window_id): > """initializes pygame into an embedded window. > must be called before any of pygame is initialized""" > > #first, set the environment variables > os.environ['SDL_WINDOWID'] = str(window_id) > if sys.platform.startswith('win'): #disable directx > os.environ['SDL_VIDEODRIVER'] = 'windib' > > #next, make it happen > pygame.init() > size = 100, 100 #doesn't really matter > return pygame.display.set_mode(size) > > > ____________________________________ > pygame mailing list > pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx > http://pygame.seul.org > -- Joseph Blaylock, UITS SC SysAdmin blaylock-GZvvpLG7cYSVc3sceRu5cw@xxxxxxxxxxxxxxxx 855-5772 ____________________________________ pygame mailing list pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx http://pygame.seul.org

Previous Message by Thread:

[pygame] pygame & gtk

Hi, I'm new at this list, so I'd like to say "Hello" to everyone on the list ;) Now, I got a lame question - is there any possibility to use a pygme (sdl) window as a part of gtk window? to put the sdl window into the gtk container? regards, Pawel -- Pawel J. Maczewski @ HIL reg.linux user #281878 ____________________________________ pygame mailing list pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx http://pygame.seul.org

Next Message by Thread:

Re: [pygame] pygame & gtk

Would something like this work with Tkinter? On Wed, 22 Jan 2003, Pete Shinners wrote: > Pawel J. Maczewski wrote: > > Now, I got a lame question - is there any possibility to use a pygme > > (sdl) window as a part of gtk window? to put the sdl window into the gtk > > container? > > there's a little voodoo to get it working, but many people have had no > problems doing this with SDL and GTK in C. here's what it pretty much > needs to by in pygame... > > > > def embed_display(window_id): > """initializes pygame into an embedded window. > must be called before any of pygame is initialized""" > > #first, set the environment variables > os.environ['SDL_WINDOWID'] = str(window_id) > if sys.platform.startswith('win'): #disable directx > os.environ['SDL_VIDEODRIVER'] = 'windib' > > #next, make it happen > pygame.init() > size = 100, 100 #doesn't really matter > return pygame.display.set_mode(size) > > > ____________________________________ > pygame mailing list > pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx > http://pygame.seul.org > -- Joseph Blaylock, UITS SC SysAdmin blaylock-GZvvpLG7cYSVc3sceRu5cw@xxxxxxxxxxxxxxxx 855-5772 ____________________________________ pygame mailing list pygame-users-eePT7DaMpNY@xxxxxxxxxxxxxxxx http://pygame.seul.org
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!