Problem with sizers

Hi All,

i am facing a simple problem but i don’t know how to solve it…

i need to fit 2 List controls and some in a Boxsizer(wx.VERTICAL)

i have declared mainSizer = wx.BoxSizer(wx.VERTICAL)

then i am caling two fns (and i passed the mainSizer to these
fns…)that will populate the list ctrls with certain coulums…

and in the end of the function i wrote

           mainSizer.Add(self.list,0,wx.ALIGN_CENTER_VERTICAL|wx.ALL,1)

there is no prob with the 1st function but in the 2nd function i am getting an error…

File “/usr/lib/python2.4/site-packages/wx-2.6-gtk2-ansi/wx/_core.py”, line 11711, in Add

return _core_.Sizer_Add(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “!sizer || m_containingSizer
!= sizer” failed in …/src/common/wincmn.cpp(1796): Adding a window to
the same sizer twice?

can anyone say wat the prob could be? i am working in Linux…

Is it becoz i am using “self.list” in both functions and adding the same to the mainSizer.

···


Regards,

Shine Anne

Yes, your intuition is correct. You have to create 2 list controls in order to have 2 lists and then add to the sizer each control. Right now you have only one list control and you’re adding it twice to the sizer.

Peter

···

On 4/11/06, Shine Anne m2ids2005@gmail.com wrote:

Hi All,

i am facing a simple problem but i don’t know how to solve it…

i need to fit 2 List controls and some in a Boxsizer(wx.VERTICAL)

i have declared mainSizer = wx.BoxSizer(wx.VERTICAL)

then i am caling two fns (and i passed the mainSizer to these
fns…)that will populate the list ctrls with certain coulums…

and in the end of the function i wrote

           mainSizer.Add(self.list,0,wx.ALIGN_CENTER_VERTICAL|wx.ALL,1)

there is no prob with the 1st function but in the 2nd function i am getting an error…

File “/usr/lib/python2.4/site-packages/wx-2.6-gtk2-ansi/wx/_core.py”, line 11711, in Add

return _core_.Sizer_Add(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “!sizer || m_containingSizer
!= sizer” failed in …/src/common/wincmn.cpp(1796): Adding a window to
the same sizer twice?

can anyone say wat the prob could be? i am working in Linux…

Is it becoz i am using “self.list” in both functions and adding the same to the mainSizer.

thanx peter…
i knew it was some silly problem…but i couldn’t figure it out…
i never came up with such a prob so i knew wat the prob was but didn’t
knew abt wat caused it? thanx anyways…saved a lot of time
other wise would have wasted a lot of time brooding on this…

···

On 4/11/06, Shine Anne m2ids2005@gmail.com wrote:

Hi All,

i am facing a simple problem but i don’t know how to solve it…

i need to fit 2 List controls and some in a Boxsizer(wx.VERTICAL)

i have declared mainSizer = wx.BoxSizer(wx.VERTICAL)

then i am caling two fns (and i passed the mainSizer to these
fns…)that will populate the list ctrls with certain coulums…

and in the end of the function i wrote

           mainSizer.Add(self.list,0,wx.ALIGN_CENTER_VERTICAL|wx.ALL,1)

there is no prob with the 1st function but in the 2nd function i am getting an error…

File “/usr/lib/python2.4/site-packages/wx-2.6-gtk2-ansi/wx/_core.py”, line 11711, in Add

return _core_.Sizer_Add(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “!sizer || m_containingSizer
!= sizer” failed in …/src/common/wincmn.cpp(1796): Adding a window to
the same sizer twice?

can anyone say wat the prob could be? i am working in Linux…

Is it becoz i am using “self.list” in both functions and adding the same to the mainSizer.

Regards,

Shine Anne


Regards,

Shine Anne