Passing events to an SDL app embedded in a GTK Widget



Hi,

sorry if this is a duplicate. I sent it from a non subscribed email
the first time.


I am writing a python app that needs to embed an SDL app in a GTK
widget. I am using an eventbox widget because it has it's own window.

I set the SDL_WINDOWID environment variable with the window id of the
eventbox and run the app. SDL apps look at this variable and use that
window id as the target for display.

It all works nicely except no mouse events get delivered to the embedded
app.

I thought that when the eventbox window contents gets focus, that is
where the events would go but I am missing something.

Is there a way to let the mouse events get through?

Here is an (incomplete) example of the kind of thing I am trying to do.

evb = xml.get_widget('event_box1')
evb.realize()
os.environ['SDL_WINDOWID'] = '%d' % evb.window.xid
os.spawnl(os.P_NOWAIT, '/usr/bin/neverball')

back to GTK event processing.

Thanks for any help.







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