event order



Hi,

is there any rule of thumb for predicting the order of events occuring?
Or where in the code of GTK+1.2 do I have to look?


<background>
The last two days I spent hunting a somewhat simple bug:

A GtkDialog has one GtkCList and two buttons. Since I have to map some
keypresses to other key events by rewriting them, there's an event
handler on the clist's "event" event, this is the only place I know to
get keypresses before the list eats them up.

The "OK" button has a "clicked" handler and a hotkey on this handler.
When fired, this event goes first to the buttons callback and second to
the other handler for "event" on the clist, because it has the focus.

The destruction of the dialog happened in the first handler and
triggered the crash by the second occurance for the no more existing
dialog.

Maybe it would be possible to make the buttons event handler signal the
event is handled ...
</background>

Marc





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