commit-gnue
[Top][All Lists]
Advanced

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

gnue/common/doc Menus.txt


From: Jason Cater
Subject: gnue/common/doc Menus.txt
Date: Fri, 01 Feb 2002 22:41:05 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/02/01 22:41:05

Modified files:
        common/doc     : Menus.txt 

Log message:
        expounded on jamest's thoughts

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/doc/Menus.txt.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/common/doc/Menus.txt
diff -c gnue/common/doc/Menus.txt:1.1 gnue/common/doc/Menus.txt:1.2
*** gnue/common/doc/Menus.txt:1.1       Fri Feb  1 22:31:49 2002
--- gnue/common/doc/Menus.txt   Fri Feb  1 22:41:05 2002
***************
*** 19,25 ****
  
  If a GMenu contains children it links to a submenu.  
  
! If a GMenu contains children and had a trigger associated with it the trigger 
  will be used to manipulate the submenu selections prior to displaying.
  
  
--- 19,25 ----
  
  If a GMenu contains children it links to a submenu.  
  
! If a GMenu contains children and had a trigger associated with it the trigger
  will be used to manipulate the submenu selections prior to displaying.
  
  
***************
*** 31,38 ****
    keymapperEvent - The name of a keymapper event entry that would have the 
same effect as 
                   - firing 
    triggerName - the NAMED trigger this menu item should fire upon selection
!                 
!   
  
  
  ---Toolbars---
--- 31,38 ----
    keymapperEvent - The name of a keymapper event entry that would have the 
same effect as 
                   - firing 
    triggerName - the NAMED trigger this menu item should fire upon selection
! 
! 
  
  
  ---Toolbars---
***************
*** 41,43 ****
--- 41,90 ----
  selecting the menu item.  It's basically a graphical symlink to a menu item
  
  If a menu item is disabled the toolbar item is automatically disabled as well
+ 
+ 
+ 
+ ---Events/bindings---
+ 
+ 
+ 1. GFInstance (or GFForm, etc) keeps track of application-level event slots
+    and their methods.
+      self._appEvents = {
+         'APPSAVE': self._save,
+         'APPEXIT': self._exit,
+         ... }
+ 
+ 2. GFInstance has a generic event catcher for these app-level events
+      def appEvent(self, event):
+        if self._appEvents.has_key(event.type[6:]):
+          self._appEvents[event.type[6:]](event)
+ 
+ 3. GFInstance adds the events in self._appEvents to its incommingEvents map.
+      for key in self._appEvents.keys():
+        self.incommingEvents['action%s' % key] = self.appEvent
+    This establishes the default behavior
+ 
+ 4. Any <menu event="APPSAVE"> tags are loaded.  If any overload an existing
+    event, then
+       instance._appEvent[event] = triggerName
+ 
+ 5. 2 new events are introduced... disableEVENT and enableEVENT.
+    Anytime a trigger wants to disable an event (grey it out),
+    it generates this event (however a trigger would do that :)
+ 
+ 6. GFInstance listens for this event, as does the toolbar and the
+    menu bar.  The menu bar and toolbar grey the items out.  GFInstance
+    keeps track of any disabled events (via a flag-type dict:
+ 
+      def appEvent(self, event):
+       if self._disabledEvents.has_key('APPSAVE'): return
+       .. previous code...
+ 
+    This takes care of actually dismissing the event however it was generated.
+ 
+ 7. Menu selections, Hotkeys, and Toolbar buttons all generate a
+    'requestAPPSAVE' (or whatever), which is caught and either passed on
+    or dismissed by GFInstance.appEvent().
+ 
+ 
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]