On Wed, Mar 26, 2003 at 08:02:16PM +0800, James Henstridge wrote:
> Antoon Pardon wrote:
> 
> >Explain the difference between signals and events.
> >As far I as a complete newbie understand the two are
> >extremely similar to the point there is no reason
> >to have both. Which makes it confusing to have them
> >both without explanation about why having them both.
> >
> Events are things sent to the application by the X server.  Signals are 
> a generic notification system used in GTK (and related libraries).  GTK 
> uses signals to notify your application when events come in.

In other words, everything that is transmitted inside GTK+ is a signal.
Some signals originate from X events and are wrapped/converted into GTK+
signals; other signals are emitted directly from GTK+ code. The main
difference from the user's standpoint are:

    a) Events can be selectively masked in/out by using
       set_events/add_events.
    
    b) Event signal callbacks receive a GdkEvent object as a parameter,
       which contains data relating to the event (x and y coordinates, key
       pressed, button clicked, etc)

(Am I more or less correct?)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to