/[papo]/gnue/common/doc/technotes/00008.txt
ViewVC logotype

Diff of /gnue/common/doc/technotes/00008.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by styxman, Fri Nov 15 15:32:54 2002 UTC revision 1.1.2.1 by anthonyl, Tue Mar 4 22:09:31 2003 UTC
# Line 61  and your object. EventAware exposes two Line 61  and your object. EventAware exposes two
61     * dispatchEvent(event)     * dispatchEvent(event)
62        
63       This method takes an Event() instance and passes it to the       This method takes an Event() instance and passes it to the
64       EventController for propogation throughout the event model.       EventController for propagation throughout the event model.
65            
66       For example, take our donut factory class.  When fresh donuts are       For example, take our donut factory class.  When fresh donuts are
67       available, it might dispatch the 'FreshDonutsReady':       available, it might dispatch the 'FreshDonutsReady':
# Line 72  and your object. EventAware exposes two Line 72  and your object. EventAware exposes two
72       to receive that event in order to dispatch it.  In other words,       to receive that event in order to dispatch it.  In other words,
73       DonutFactory doesn't care what happens when the FreshDonutsReady event       DonutFactory doesn't care what happens when the FreshDonutsReady event
74       is raised.       is raised.
75        
76         As of GNUe-Common 0.5.0, dispatchEvent can be passed a string, followed
77         by an arbitrary number of named parameters.  This will implicitly create
78         an event.  For example, the following two statements are now equivalent:
79    
80               self.dispatchEvent(Event('FreshDonutsReady',quantity=48))
81    
82               self.dispatchEvent('FreshDonutsReady',quantity=48)
83    
84         If you need a result or an error code from an event, you will still need
85         to explicitly create an event to pass to dispatchEvent.
86    
87    
88    
89  Event  Event
# Line 89  Would create an event called MyEvent, wi Line 101  Would create an event called MyEvent, wi
101    
102     Event.x = 1     Event.x = 1
103     Event.y = 2     Event.y = 2
104     Event.color = 'Blue'1     Event.color = 'Blue'
105    
106    
107  An event has the following methods/attributes:  An event has the following methods/attributes:

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26