From: sturlamolden on
On 14 Nov, 15:35, Dietmar Schwertberger <n...(a)schwertberger.de> wrote:

>    self.m_toolBar1 = self.CreateToolBar( wx.TB_HORIZONTAL, wx.ID_ANY )
>    self.m_button1 = wx.Button( self.m_toolBar1, wx.ID_ANY, u"MyButton",
> wx.DefaultPosition, wx.DefaultSize, 0 )
>    m_toolBar1.AddControl( m_button1 )

I can confirm this. There seems to be a bug in the generation of
Python code for wxToolBar.




From: Dietmar Schwertberger on
sturlamolden schrieb:
> On 14 Nov, 15:35, Dietmar Schwertberger <n...(a)schwertberger.de> wrote:
>
>> self.m_toolBar1 = self.CreateToolBar( wx.TB_HORIZONTAL, wx.ID_ANY )
>> self.m_button1 = wx.Button( self.m_toolBar1, wx.ID_ANY, u"MyButton",
>> wx.DefaultPosition, wx.DefaultSize, 0 )
>> m_toolBar1.AddControl( m_button1 )
>
> I can confirm this. There seems to be a bug in the generation of
> Python code for wxToolBar.

If anybody faces this problem before a new revision of wxFormBuilder
will be available: an XML file need to be updated to correctly
include self.

The modification:

wxformbuilder\output\plugins\common\xml\menutoolbar.pythoncode:

<codegen language="Python">
<templates class="wxWindow">
<template name="toolbar_add">self.#parent $name.AddControl(
self.$name )</template>
</templates>



Regards,

Dietmar