[gnue] r9525 - in trunk/gnue-forms/src/uidrivers: gtk2/widgets wx/widgets

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: jan
Date: 2007-04-26 03:27:10 -0500 (Thu, 26 Apr 2007)
New Revision: 9525

Modified:
   trunk/gnue-forms/src/uidrivers/gtk2/widgets/toolbar.py
   trunk/gnue-forms/src/uidrivers/wx/widgets/toolbutton.py
Log:
fix suppressed toolbar for wx uidriver


Modified: trunk/gnue-forms/src/uidrivers/gtk2/widgets/toolbar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/widgets/toolbar.py	2007-04-26 08:22:22 UTC (rev 9524)
+++ trunk/gnue-forms/src/uidrivers/gtk2/widgets/toolbar.py	2007-04-26 08:27:10 UTC (rev 9525)
@@ -63,7 +63,7 @@
                     gtk.EXPAND | gtk.FILL, 0,
                     0,                     0)
 
-            if hasattr(self._uiForm,"_tooltips"):
+            if not hasattr(self._uiForm,"_tooltips"):
                 self._uiForm._tooltips = gtk.Tooltips()
 
         self._container = widget

Modified: trunk/gnue-forms/src/uidrivers/wx/widgets/toolbutton.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/widgets/toolbutton.py	2007-04-26 08:22:22 UTC (rev 9524)
+++ trunk/gnue-forms/src/uidrivers/wx/widgets/toolbutton.py	2007-04-26 08:27:10 UTC (rev 9525)
@@ -50,27 +50,32 @@
         description = self._gfObject.description
         check = (self._gfObject.action_off is not None)
 
-        if label is not None:
-            if check:
-                kind = wx.ITEM_CHECK
-            else:
-                kind = wx.ITEM_NORMAL
+        if event.container is not None:
+            if label is not None:
+                if check:
+                    kind = wx.ITEM_CHECK
+                else:
+                    kind = wx.ITEM_NORMAL
 
-            if icon_file:
-                image = wx.Image(icon_file, wx.BITMAP_TYPE_PNG)
+                if icon_file:
+                    image = wx.Image(icon_file, wx.BITMAP_TYPE_PNG)
+                else:
+                    image = None
+
+                self.__toolbar = event.container
+                self.__id = wx.NewId()
+                widget = event.container.AddLabelTool(self.__id, label,
+                        image.ConvertToBitmap(), kind=kind, shortHelp=label,
+                        longHelp=(description or u""))
+
+                wx.EVT_TOOL(event.container, self.__id, self.__on_tool)
             else:
-                image = None
+                widget = None
+                event.container.AddSeparator()
 
-            self.__toolbar = event.container
-            self.__id = wx.NewId()
-            widget = event.container.AddLabelTool(self.__id, label,
-                    image.ConvertToBitmap(), kind=kind, shortHelp=label,
-                    longHelp=(description or u""))
-
-            wx.EVT_TOOL(event.container, self.__id, self.__on_tool)
         else:
+            # TOOLBAR:SUPPRESS was set
             widget = None
-            event.container.AddSeparator()
 
         self.__widget = widget
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.