Re: [gtkmm] Talk about a major rewrite



>>      gtk_signal_emit_stop_by_name()
>> 
>> :) fortunately, gtkmm2 (and GTK+ 2) should change all that nonsense.
>
>I've heard of this but never used it. Is it an alternative to the ugly 
>flag approach I mentioned above? Could you please elaborate on how you 
>use it and how gtkmm2 will help? Thanks.

in gtk+ 1.2, its hard to stop the default handler for an event from
actually running. the simple description of how handlers work is not
accurate: returning TRUE from a connected handler does *not* stop the
default handler from being executed. eg. handling button_press_event
yourself and returning true doesn't stop a GtkButton from doing its
normal thing with a button_press_event (or any other signal).

so, you call gtk_signal_emit_stop_by_name from your handler, and
nothing else happens after your handler returns. if you didn't want
the button to become "depressed", it doesn't.

in GTK+2, returning TRUE from any handler stops all further handling
of the event, just like the description in the introductions to GTK+
suggest it will.

--p



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