I assign items to the toolbar like this:
tb.AddTool(b[1], b[2], bmp, disabled_bitmap=wx.NullBitmap,
kind=b[7],
short_help_string=b[4], long_help_string=b[4],
client_data=None, target=None)
Works on Windows but on Ubuntu I see this exception:
File "/home/wbruhin/devTools/medialocker/mlsrc/mediaLocker.py", line 63, in __init__
tb = self.doMainTB(self._mgr, self)
File "/home/wbruhin/devTools/medialocker/mlsrc/mediaLocker.py", line 149, in doMainTB
uiutils.doCreateToolbarItems(self, mainTB, tools)
File "/home/wbruhin/devTools/medialocker/mlsrc/libui/uiutils.py", line 207, in doCreateToolbarItems
client_data=None, target=None)
TypeError: AddTool() got an unexpected keyword argument 'target'
So, as I don't use them I just remove them, but that doesn't work on Windows nor on *nix, I get this exception on Windows:
File "F:\devProjectsT\MikeD\MediaLockerTemp\mlsrc\mediaLocker.py", line 149, in doMainTB
uiutils.doCreateToolbarItems(self, mainTB, tools)
File "F:\devProjectsT\MikeD\MediaLockerTemp\mlsrc\libui\uiutils.py", line 206, in doCreateToolbarItems
short_help_string=b[4], long_help_string=b[4])
TypeError: AddTool() takes exactly 10 arguments (8 given)
And this on Windows:
tb = self.doMainTB(self._mgr, self)
File "/home/wbruhin/devTools/medialocker/mlsrc/mediaLocker.py", line 149, in doMainTB
uiutils.doCreateToolbarItems(self, mainTB, tools)
File "/home/wbruhin/devTools/medialocker/mlsrc/libui/uiutils.py", line 206, in doCreateToolbarItems
short_help_string=b[4], long_help_string=b[4])
TypeError: AddTool() takes exactly 9 non-keyword arguments (8 given)
Looking at aui.auibar.Add* methods I see that they are not very consistent, sometimes keyword, sometimes not.
What would be a good way to fix this up? Would keywords everywhere be o.k.?
Werner