dabo Commit
Revision 4427
Date: 2008-08-21 06:45:26 -0700 (Thu, 21 Aug 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4427

Changed:
U   trunk/dabo/ui/uiwx/dMenuItem.py

Log:
This is a display fix for regular dMenuItems.  If there wasn't an image 
assigned to the dMenuItem on creation, dabo would set a tiny image that was 1 
pixel which was black.  At first I thought I would change the pixel to white 
but it is glaring on the menu highlight.  Then, I thought why not just return 
when passed None or "" and don't set the bitmap.

The only downside to this approach is that you can't set an image and then go 
back to no image.  However, given that it is a very rare case, I thought that 
it was justified.

Diff:
Modified: trunk/dabo/ui/uiwx/dMenuItem.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenuItem.py     2008-08-21 12:30:02 UTC (rev 4426)
+++ trunk/dabo/ui/uiwx/dMenuItem.py     2008-08-21 13:45:26 UTC (rev 4427)
@@ -137,11 +137,11 @@
 
        def _setIcon(self, val):
                if self._constructed():
+                       if val in (None, ""):
+                               return
                        if isinstance(val, basestring):
                                # Icon name was passed; get the actual bitmap
                                val = dabo.ui.strToBmp(val)
-                       if val is None:
-                               val = wx.EmptyBitmap(1, 1)
                        self.SetBitmap(val)
 
                        # Win32 at least needs the following line, or the 
caption




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to