disable item in toolbar does not work

hi all.
I have a toolbar with a set of item but I can not disable someone.
The metod is 'enableItemToolBar'.
For sample there is one bitmap.
Follow the code.
My system is Linux and wxpython 2.8.9.1-r2

thanks

_menu.py (9.88 KB)

icon2.gif

···

--
Fabio Spadaro
www.fabiospadaro.com

the issue doe not occur on Window Vista.
it's very strange.
someone has ideas?

···

2009/9/11 Fabio Spadaro <fabiolinospad@gmail.com>:

hi all.
I have a toolbar with a set of item but I can not disable someone.
The metod is 'enableItemToolBar'.
For sample there is one bitmap.
Follow the code.
My system is Linux and wxpython 2.8.9.1-r2

thanks

--
Fabio Spadaro
www.fabiospadaro.com

--
Fabio Spadaro
www.fabiospadaro.com

I solved the issue by using 'AddTool' instead of 'AddSimpleTool':

NEW
    def createToolBar(self,parent):
        ...
        fil = 'icon2.gif'
        bmp = wx.Image(fil,wx.BITMAP_TYPE_GIF).ConvertToBitmap()
        self.toolbarCreateDb = toolbar.AddTool(wx.NewId(),
bmp,wx.NullBitmap, wx.ITEM_NORMAL,
                "Create a new Database","")
...
    def enableItemToolBar(self,parent):
        toolbar = parent.GetToolBar()
        Id = self.toolbarCloseDb.GetId()
        toolbar.EnableTool(Id,False)

···

2009/9/11 Fabio Spadaro <fabiolinospad@gmail.com>:

hi all.
I have a toolbar with a set of item but I can not disable someone.
The metod is 'enableItemToolBar'.
For sample there is one bitmap.
Follow the code.
My system is Linux and wxpython 2.8.9.1-r2

thanks

--
Fabio Spadaro
www.fabiospadaro.com

--
Fabio Spadaro
www.fabiospadaro.com