Re: difference between event and signal



What means the Run First, Run Last and others in
http://library.gnome.org/devel/gtk/unstable/GtkWidget.htm at Signals?

2010/1/13 frederico schardong <frede sch gmail com>:
> Thanks!
>
> 2010/1/13 Ben Pfaff <blp cs stanford edu>:
>> frederico schardong <frede sch gmail com> writes:
>>
>>> I'm confusing about the difference between event and signal.
>>
>> According to the GTK+ FAQ:
>>
>> First of all, Havoc Pennington gives a rather complete
>> description of the differences between events and signals in his
>> free book (two chapters can be found at
>> http://www106.pair.com/rhp/sample_chapters.html).
>>
>> Moreover, Havoc posted this to the gtk-list "Events are a stream
>> of messages received from the X server. They drive the Gtk main
>> loop; which more or less amounts to "wait for events, process
>> them" (not exactly, it is really more general than that and can
>> wait on many different input streams at once). Events are a
>> Gdk/Xlib concept."
>>
>> "Signals are a feature of GtkObject and its subclasses. They have
>> nothing to do with any input stream; really a signal is just a
>> way to keep a list of callbacks around and invoke them ("emit"
>> the signal). There are lots of details and extra features of
>> course. Signals are emitted by object instances, and are entirely
>> unrelated to the Gtk main loop. Conventionally, signals are
>> emitted "when something changes" about the object emitting the
>> signal."
>>
>> "Signals and events only come together because GtkWidget happens
>> to emit signals when it gets events. This is purely a
>> convenience, so you can connect callbacks to be invoked when a
>> particular widget receives a particular event. There is nothing
>> about this that makes signals and events inherently related
>> concepts, any more than emitting a signal when you click a button
>> makes button clicking and signals related concepts."
>>
>> --
>> "Now I have to go wash my mind out with soap."
>> --Derick Siddoway
>>
>> _______________________________________________
>> gtk-list mailing list
>> gtk-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>
>
>
>
> --
> Thanks,
> Frederico Schardong,
> SOLIS - Open source solutions
> www.solis.coop.br
> Linux registered user #500582
>



-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582


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