Phoenix - menu

Hi Robin,

I started working to get Dabo to work with Phoenix and I get the following exception on this:

preClass.__init__(self, *args, **kwargs)

*args = ()
**kwargs = {}

Will you add an additional overload for that? Or ....?

Werner

TypeError: Menu(): arguments did not match any overloaded call:
overload 1: not enough arguments
overload 2: not enough arguments
File "c:\dev\dabo\dabo\ui\uiwx\dSlidePanelControl.py", line 912, in <module>
   app.start()
File "c:\dev\dabo\dabo\dApp.py", line 388, in start
   self.setup()
File "c:\dev\dabo\dabo\dApp.py", line 340, in setup
   self.initUIApp()
File "c:\dev\dabo\dabo\dApp.py", line 380, in initUIApp
   self.uiApp.setup()
File "c:\dev\dabo\dabo\ui\uiwx\uiApp.py", line 435, in setup
   frm = self.dApp.MainForm = mfc()
File "c:\dev\dabo\dabo\ui\uiwx\dForm.py", line 1047, in __init__
   *args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dForm.py", line 40, in __init__
   attProperties=attProperties, *args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dFormMixin.py", line 76, in __init__
   attProperties=attProperties, *args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dPemMixin.py", line 202, in __init__
   self._afterInit()
File "c:\dev\dabo\dabo\ui\uiwx\dForm.py", line 58, in _afterInit
   super(BaseForm, self)._afterInit()
File "c:\dev\dabo\dabo\ui\uiwx\dFormMixin.py", line 96, in _afterInit
   self.MenuBar = mbc()
File "c:\dev\dabo\dabo\ui\uiwx\dMenuBar.py", line 21, in __init__
   pm.dPemMixin.__init__(self, preClass, None, properties, *args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dPemMixin.py", line 202, in __init__
   self._afterInit()
File "c:\dev\dabo\dabo\ui\uiwx\dBaseMenuBar.py", line 184, in _afterInit
   self.fileMenu = self.appendMenu(FileMenu(self, MenuID="base_file"))
File "c:\dev\dabo\dabo\ui\uiwx\dBaseMenuBar.py", line 26, in __init__
   super(FileMenu, self).__init__(*args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dMenu.py", line 47, in __init__
   attProperties=attProperties, *args, **kwargs)
File "c:\dev\dabo\dabo\ui\uiwx\dPemMixin.py", line 189, in __init__
   preClass.__init__(self, *args, **kwargs)

Werner wrote:

Hi Robin,

I started working to get Dabo to work with Phoenix and I get the
following exception on this:

preClass.__init__(self, *args, **kwargs)

*args = ()
**kwargs = {}

Will you add an additional overload for that? Or ....?

SIP wraps functions that take zero parameters in a away that is not compatible with processing *args and **kwargs, even if they are empty. Is preClass wx.Menu or the old PreMenu factory? Anyway if it's known that the function/method being called has no args then you should call it with () or (self) depending on context.

···

--
Robin Dunn
Software Craftsman