[SDL] Events problem with a pygtk hosted SDL app
Alvin
alvinbeach at gmail.com
Thu Jan 4 10:00:36 PST 2007
On Wednesday 08 November 2006 20:55, Mike Cruse wrote:
> Hi,
>
> I have been trying out the SDL_WINDOWID hack(?) and I have it working
> quite well as far as displaying an SDL app in a pygtk window.
>
> My problem is that events (as in mouse) don't get delivered to the SDL
> app and I don't understand why.
>
> Any clues on the list?
>
> I am trying this with some games like neverball and ppracer.
>
> As an alternative I have been able to re-parent an SDL app with some gdk
> magic once I have the the X window id. That was a little tricky as SDL
> was using the wrong type for the WM_NAME X property. An upgrade to the
> 1.2.10 fixed that.
>
> I would still like to use the SDL_WINDOWID method though.
>
> Any ideas would be appreciated.
I use SDL_WINDOWID to embedd an SDL screen into a FLTK app. In order to
receive the SDL events, I had to catch the FLTK events (mouse motion, mouse
pressed, etc.), map them into SDL events and then put the mapped SDL events
into SDL's event queue. Then I am able to see the events in my SDL event
loop.
The issue that occurs is that once the SDL screen is embedded, the events are
first captured by the toolkit (in my case, by FLTK). Mapping the toolkit's
events into the SDL events is done my manually creating the SDL event and
populating it with the event information provided by the toolkit.
Here's a link to the documentation for putting "hand made" events into SDL's
event queue:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fPushEvent
Alvin
More information about the SDL
mailing list