commit-gnue
[Top][All Lists]
Advanced

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

r6022 - in trunk/gnue-forms/src/uidrivers/gtk2: . widgets/form


From: johannes
Subject: r6022 - in trunk/gnue-forms/src/uidrivers/gtk2: . widgets/form
Date: Thu, 22 Jul 2004 02:32:45 -0500 (CDT)

Author: johannes
Date: 2004-07-22 02:32:44 -0500 (Thu, 22 Jul 2004)
New Revision: 6022

Modified:
   trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py
   trunk/gnue-forms/src/uidrivers/gtk2/ToolBar.py
   trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py
Log:
Fixed calling of other forms via runForm (). Toolbar- and Menu-Icons cannot be 
cached in GTK2 without reparenting an the like


Modified: trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py      2004-07-21 22:22:55 UTC 
(rev 6021)
+++ trunk/gnue-forms/src/uidrivers/gtk2/MenuBar.py      2004-07-22 07:32:44 UTC 
(rev 6022)
@@ -79,9 +79,10 @@
     hotkey  = userAction.getHotKeyText ()
     iconloc = userAction.getIconLocation (size = "16x16")
 
-    # TODO: do we need an accelerator group ? AccelLabel doesn't work ...
+    # TODO: We need to create an accelerator group on the toplevel window and
+    #       request the GFKeyMapper to split the key into it's parts
     if hotkey:
-      label = "%s\t%s" % (label, hotkey)
+      label = "%s\t\t%s" % (label, hotkey)
 
     item = gtk.ImageMenuItem (self.correctLabel (label))
 
@@ -91,12 +92,8 @@
 
     # Set the action icon if available
     if iconloc:
-      if _cachedIcons.has_key (iconloc):
-        icon = _cachedIcons [iconloc]
-      else:
-        icon = gtk.Image ()
-        icon.set_from_file (iconloc)
-        _cachedIcons [iconloc] = icon
+      icon = gtk.Image ()
+      icon.set_from_file (iconloc)
 
       item.set_image (icon)
 
@@ -135,6 +132,3 @@
 
   def disableItem (self, item):
     item.set_sensitive (0)
-    
-
-_cachedIcons = {}

Modified: trunk/gnue-forms/src/uidrivers/gtk2/ToolBar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/ToolBar.py      2004-07-21 22:22:55 UTC 
(rev 6021)
+++ trunk/gnue-forms/src/uidrivers/gtk2/ToolBar.py      2004-07-22 07:32:44 UTC 
(rev 6022)
@@ -74,12 +74,8 @@
       print "** WARNING: Cannot add '%s' to toolbar; no icon" % 
userAction.event
       return
 
-    if _cachedIcons.has_key (iconloc):
-      icon = _cachedIcons [iconloc]
-    else:
-      icon = gtk.Image ()
-      icon.set_from_file (iconloc)
-      _cachedIcons [iconloc] = icon
+    icon = gtk.Image ()
+    icon.set_from_file (iconloc)
 
     if userAction.canToggle:
       button = self.toolbar.append_element (gtk.TOOLBAR_CHILD_TOGGLEBUTTON,
@@ -153,6 +149,3 @@
   def endingItem (self, item):
     if item is not None:
       item.set_active (0)
-        
-    
-_cachedIcons = {}

Modified: trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py  2004-07-21 
22:22:55 UTC (rev 6021)
+++ trunk/gnue-forms/src/uidrivers/gtk2/widgets/form/widget.py  2004-07-22 
07:32:44 UTC (rev 6022)
@@ -55,8 +55,6 @@
 
   def _createWidget (self, event, spacer):
 
-    gDebug (1, "Creating form for %s" % event.object)
-
     gfObject = event.object
 
     self.menu_sb_space = 0
@@ -85,11 +83,9 @@
                  0,                      0)
       self.containerFrame.show ()
       self.createStatusBar ()
-      gDebug (1, "Created mainWindow: %s" % self.mainWindow)
       
 
     else:
-      gDebug (1, "Creating a new dialog")
       self.mainWindow = gtk.Dialog (flags = gtk.DIALOG_NO_SEPARATOR |
           gtk.DIALOG_DESTROY_WITH_PARENT)
       self.mainWindow.set_resizable (gtk.TRUE)





reply via email to

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