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

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@seul.org
> http://pygame.seul.org
>

-- 
Joseph Blaylock, UITS SC SysAdmin
blaylock@indiana.edu     855-5772

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