Re: [gtk-list] Re: How to redefine button functionality on aGtkTree?



On 20 Jan 1999, Thomas Mailund Jensen wrote:

> Now, for question two...here you need to know a little more about
> signal/event handling.  I quote from the tutorial "20.2 Signal
> Emission and Propagation":
> 
>   Signal emission is the process wherby GTK+ runs all handlers for a
>   specific object and signal.
> 
>   First, note that the return value from a signal emission is the
>   return value of the last handler executed.  Since event signals are
>   all of type GTK_RUN_LAST, this will be the default (GTK+ supplied)
>   default handler, unless you connect with gtk_signal_connect_after().
> 
>   The way an event (say GTK_BUTTON_PRESS) is handled, is: 
> 
>    *  Start with the widget where the event occured. 
> 
>    * Emit the generic "event" signal. If that signal handler returns a
>      value of TRUE, stop all processing.

it should be noted that the emission of the signal is continued regardless
of any handler's return value. so it is always the last handler's that is
actually evaluated after signal emission.

>    * Otherwise, emit a specific, "button_press_event" signal. If that
>      returns TRUE, stop all processing.  Otherwise, go to the widget's
>      parent, and repeat the above steps.

same applies here.

>    * Contimue until some signal handler returns TRUE, or until the
>      top-level widget is reached.

this should say "until the last handler of a signal emission returns
TRUE". apart from that, not all signals will get propagated up the
widget heirarchy, those that will get propagated are:

GDK_KEY_PRESS, GDK_KEY_RELEASE, GDK_MOTION_NOTIFY, GDK_BUTTON_PRESS,
GDK_2BUTTON_PRESS, GDK_3BUTTON_PRESS, GDK_BUTTON_RELEASE, GDK_PROXIMITY_IN,
GDK_PROXIMITY_OUT.

>   Some consequences of the above are: 
> 
>    * Your handler's return value will have no effect if there is a
>      default handler, unless you connect with
>      gtk_signal_connect_after().

and the return value of the handler will be overridden by the return
value of additional handlers that got connected later (just for
completeness).

> 
> 	/mailund
> 

---
ciaoTJ



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