Basil Shubin wrote:
Hmm... Looks like the all 'app = self.Application' have its own 'protective' code! You can check it.

So what to check next? Is there possible solution for a thing I need?

Okay, a better look at that traceback shows me that the problem is in dMenu.py:

File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dGrid.py", line 2768, in _onGridMouseRightClick
    menu = dabo.ui.dMenu()
File "/usr/lib/python2.4/site-packages/Dabo-0.6.5s-py2.4.egg/dabo/ui/uiwx/dMenu.py", line 32, in __init__
    self.Application.uiApp.Bind(wx.EVT_MENU_OPEN, self.__onWxMenuOpen)
AttributeError: 'NoneType' object has no attribute 'uiApp'

The grid instantiates a menu for the right-click context menu, and the menu requires access to the application object. However, there are other ways to get at the wx app object. Here's a patch that will probably get around this problem:

[EMAIL PROTECTED]:~/projects/dabo-0.6.5/dabo/ui/uiwx$ svn diff
Index: dMenu.py
===================================================================
--- dMenu.py    (revision 2380)
+++ dMenu.py    (working copy)
@@ -29,8 +29,13 @@
## maps the id of the wxMenuItem to the dMenuItem object.
                self._daboChildren = {}
pm.dPemMixin.__init__(self, preClass, parent, properties, *args, **kwargs) - self.Application.uiApp.Bind(wx.EVT_MENU_OPEN, self.__onWxMenuOpe n) - self.Application.uiApp.Bind(wx.EVT_MENU_CLOSE, self.__onWxMenuCl ose)
+
+ # Could be that we are used without a Dabo app object (not recom mended, + # but should be possible). So use the wx-method for getting the uiApp ref,
+               # instead of the Dabo way of self.Application.uiApp
+               uiApp = wx.GetApp()
+               uiApp.Bind(wx.EVT_MENU_OPEN, self.__onWxMenuOpen)
+               uiApp.Bind(wx.EVT_MENU_CLOSE, self.__onWxMenuClose)
                if self._useMRU:
self.bindEvent(dEvents.MenuOpen, self._onMenuOpenMRU)




--
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to