Re: [pygame] get_wm_info on linux

2008-03-12 Thread John
hi i create subwindow for mplayer like this: first you need some imports: from ctypes import * Xlib = CDLL(libX11.so.6) Xtst = CDLL(libXtst.so.6) def create_subwindow(x,y,width,height): pygame_win = pygame.display.get_wm_info()[window] dpy = Xtst.XOpenDisplay(None) win =

Re: [SPAM: 3.000] Re: [pygame] get_wm_info on linux

2008-03-07 Thread Lenard Lindstrom
Greg Ewing wrote: It seems like it should be possible to get the long from the PyCObject (info['display']) just as well as it was done from the c code PyCObjects are opaque from Python code -- there's no way to extract an address from one without using C code. ctypes can. -- Lenard

Re: [pygame] get_wm_info on linux

2008-03-06 Thread Patrick Mullen
On Wed, Mar 5, 2008 at 9:47 PM, René Dudfield [EMAIL PROTECTED] wrote: Is window as an int in there? Have a look at src/display.c There you'll see the X11 properties put in there. Is this what you're after? info = pygame.display.get_wm_info() windowid = info.get(window) print

Re: [pygame] get_wm_info on linux

2008-03-06 Thread Greg Ewing
Patrick Mullen wrote: ogre is expecting a string like this: display *:screenid,windowid, and I'm not sure how you would put a display * as a string. What *exactly* does the piece of documentation you're looking at say? That doesn't seem to make any sense. -- Greg

Re: [pygame] get_wm_info on linux

2008-03-06 Thread Patrick Mullen
Well here's the documentation for ogre: RenderWindow * createRenderWindow (const String name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0) ... miscParams A NameValuePairList describing the other parameters for the new rendering

Re: [pygame] get_wm_info on linux

2008-03-06 Thread Greg Ewing
Patrick Mullen wrote: Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None) I don't think these are strings, I think they're meant to be some

Re: [pygame] get_wm_info on linux

2008-03-06 Thread Patrick Mullen
Well, I managed to get it to work by hacking pygame src/display.c :) It is actually a string it is looking for, and I'm not totally sure how the conversion works (not totally clear on what a void * really is etc), but here is my addition to display.c that made the value usable: get_wm_info

Re: [SPAM: 3.000] Re: [pygame] get_wm_info on linux

2008-03-06 Thread Greg Ewing
Patrick Mullen wrote: Well, I managed to get it to work by hacking pygame src/display.c :) It is actually a string it is looking for, and I'm not totally sure how the conversion works Looks like it's treating the memory address as an integer and turning it into a decimal string. It seems

[pygame] get_wm_info on linux

2008-03-05 Thread Patrick Mullen
I am embedding ogre in a pygame window, which is working fine on windows, but on linux ogre needs not only the window handle, but also a display pointer and screen id. Fortunately, pygame.display.get_wm_info() returns a display field, and the screen id I assume is just zero. Unfortunately, the