dabo Commit
Revision 7126
Date: 2012-03-29 13:59:36 -0700 (Thu, 29 Mar 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7126

Changed:
U   trunk/dabo/ui/uiwx/dFormMixin.py
U   trunk/dabo/ui/uiwx/dMenu.py

Log:
I finally figured out something that's been bugging me on Mac for years now, 
where
the app menu's Preferences item would either dim or not do anything after a 
while.
Mac simply needs some extra help assigning the preferences item each time a new
form becomes active. Even instantiating a menu-less form and never showing it 
was
enough to dim the Preferences item, probably because that menu id wasn't 
associated
with the menubar for the active form.

What this commit does is reassign the preferences menu id on every activate 
cycle,
and it seems to fix the problem for me.


Diff:
Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py    2012-03-28 17:54:02 UTC (rev 7125)
+++ trunk/dabo/ui/uiwx/dFormMixin.py    2012-03-29 20:59:36 UTC (rev 7126)
@@ -163,6 +163,11 @@
                        if app is not None:
                                if app.Platform != "Win":
                                        app.ActiveForm = self
+                       mb = self.MenuBar
+                       if mb:
+                               pref_id = getattr(mb, "_mac_pref_menu_item_id", 
None)
+                               if pref_id:
+                                       
wx.App_SetMacPreferencesMenuItemId(pref_id)
                else:
                        self.raiseEvent(dEvents.Deactivate, evt)
                evt.Skip()

Modified: trunk/dabo/ui/uiwx/dMenu.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenu.py 2012-03-28 17:54:02 UTC (rev 7125)
+++ trunk/dabo/ui/uiwx/dMenu.py 2012-03-29 20:59:36 UTC (rev 7126)
@@ -142,6 +142,7 @@
                        return
                if special == "pref":
                        # Put the prefs item in the App Menu on Mac
+                       self.Parent._mac_pref_menu_item_id = id_
                        wx.App_SetMacPreferencesMenuItemId(id_)
 
 



_______________________________________________
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