Listbook AddPage raise the error: C++ assertion "radiobox", Should have the assoiciate radio box
羅祥友 <[email protected]> Mon, 15 Aug 2022 01:06:25 -0700 (PDT)
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_954_910794538.1660550785029
Content-Type: multipart/alternative;
boundary="----=_Part_955_1226121923.1660550785029"
------=_Part_955_1226121923.1660550785029
Content-Type: text/plain; charset="UTF-8"
Hi all,
I am trying to create the listbook and it adds a lot of pages as below
code. Just implement the window with multiple notebooks and *some of
notebooks have two pages*. But I encounter the error as below description.
Can anyone help me to identify the error?
*wx._core.wxAssertionError: C++ assertion ""radiobox"" failed at
..\..\src\msw\radiobox.cpp(793) in wxRadioBtnWndProc(): Should have the
associated radio box*
As below the description of code, *I do not create any radiobox*.
#################################################
import GUI_API_Window1
class FeatureList(wx.Listbook):
def __init__(self, parent): wx.Listbook.__init__(self, parent, size =
(List_len,List_width), style = wx.LB_LEFT)
pages = [
(GUI_API_Window1.Common1(self), 'Common1'),
(GUI_API_Window2.Common2(self), 'Common2'),
(GUI_API_Window3.Common3(self), 'Common3'),
(GUI_API_Window4.Common4(self), 'Common4') ]
for page, label in pages:
self.AddPage(page,label) # error
#################################################
class GUIAPIMain(wx.Frame): # For GUI API Control
def __init__(self, parent, title):
wx.Frame.__init__(self, parent = parent, size =
(APIList_len,APIList_width), title = title)
panel = wx.Panel(self)
# Add the panel for feature list with subpage and control panel
self.FeatureNotebook = FeatureList(self)
self.rightpanel = RightPanel(self)
v_sizer = wx.BoxSizer(wx.VERTICAL)
h_sizer2 = wx.BoxSizer(wx.HORIZONTAL)
h_sizer2.Add(self.FeatureNotebook)
h_sizer2.Add(self.rightpanel)
v_sizer.Add(h_sizer2)
self.SetSizer(v_sizer)
self.Show()
And one of window as below code:
#####GUI_API_Window1.py#####
class Common1(wx.Notebook):
def __init__(self, parent):
wx.Notebook.__init__(self, parent = parent, id = wx.ID_ANY)
sizer = wx.BoxSizer(wx.VERTICAL)
self.Common1= wx.Notebook(self)
window1 = Common1Window1(self.Common1)
window2 = Common1Window2(self.Common1)
self.Common1.AddPage(window1, 'Advanced settings 1', select = True)
self.Common1.AddPage(window2, 'System Default', select = False)
sizer.Add(self.Common1, 1, wx.EXPAND)
self.SetSizer(sizer)
Listbook AddPage raise the error: C++ assertion "radiobox", Should have the
assoiciate radio box
<https://stackoverflow.com/questions/73358037/listbook-addpage-raise-the-error-c-assertion-radiobox-should-have-the-asso>
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/f43a06d4-b005-495d-be00-f519ccc6aa50n%40googlegroups.com.
------=_Part_955_1226121923.1660550785029
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi all,<div><br></div><div>I am trying to create the listbook and it adds a=
lot of pages as below code. Just implement the window with multiple notebo=
oks and <strong>some of notebooks have two pages</strong>. But I encou=
nter the error as below description. Can anyone help me to identify the err=
or?<br></div><div><br></div><div><b>wx._core.wxAssertionError: C++ assertio=
n ""radiobox"" failed at ..\..\src\msw\radiobox.cpp(793) in wxRadioBtnWndPr=
oc(): Should have the associated radio box</b><br></div><div><br></div><div=
>As below the description of code, <strong>I do not create any radiobo=
x</strong>.<br></div><div>#################################################=
</div><div> import GUI_API_Window1 </div><div> class Featu=
reList(wx.Listbook): </div><div> def __init__(self, paren=
t):=20
wx.Listbook.__init__(self, parent, size =3D (List_len,List_width), styl=
e =3D wx.LB_LEFT) </div><div><br></div><div> pages =3D [</=
div><div> (GUI_API_Window1.Common1(self), 'Common1'),</d=
iv><div> (GUI_API_Window2.Common2(self), 'Common2'),&nbs=
p;</div><div> (GUI_API_Window3.Common3(self), 'Common3')=
,</div><div> (GUI_API_Window4.Common4(self), 'Common4')
] </div><div> for page, label in pages: </d=
iv><div> <font color=3D"#ff0000">self.AddPage(pa=
ge,label) # error</font></div><div><br></div><div>#########################=
########################<br></div><div>
class GUIAPIMain(wx.Frame): # For GUI API Control </div><div> &=
nbsp; def __init__(self, parent, title): </div><div>  =
; wx.Frame.__init__(self, parent =3D parent, size =3D =
(APIList_len,APIList_width), title =3D title)&nbs=
p;</div><div> panel =3D wx.Panel(self)&nb=
sp;</div><div> # Add the panel for featur=
e list with subpage and control panel </div><div> =
self.FeatureNotebook =3D FeatureList(self) </div><div>&n=
bsp; self.rightpanel =3D RightPanel(self) =
</div><div> v_sizer =3D wx.BoxSizer(wx.VE=
RTICAL) </div><div> h_sizer2 =3D wx.=
BoxSizer(wx.HORIZONTAL) </div><div> =
h_sizer2.Add(self.FeatureNotebook) </div><div> &nb=
sp; h_sizer2.Add(self.rightpanel) </div><div> &nbs=
p; v_sizer.Add(h_sizer2)</div><div>  =
; self.SetSizer(v_sizer) </div><div> =
self.Show()<br></div><div><p>And one of window as below code:</p>##=
###GUI_API_Window1.py##### </div><div>class Common1(wx.Notebook):</div=
><div>
def __init__(self, parent): </div><div> wx.Note=
book.__init__(self, parent =3D parent, id =3D wx.ID_ANY) </div><div>&n=
bsp; sizer =3D wx.BoxSizer(wx.VERTICAL) </div><div> =
; self.Common1=3D wx.Notebook(self) </div><div> &n=
bsp; window1 =3D Common1Window1(self.Common1) </div><div> =
window2 =3D Common1Window2(self.Common1) </div><div>&nb=
sp; self.Common1.AddPage(window1, 'Advanced settings 1', sele=
ct =3D True) </div><di=
v> self.Common1.AddPage(window2, 'System Default', sele=
ct =3D False) </div><div> size=
r.Add(self.Common1, 1, wx.EXPAND) </div><div> self=
.SetSizer(sizer) <br></div><div><br></div><div><a href=3D"https://stac=
koverflow.com/questions/73358037/listbook-addpage-raise-the-error-c-asserti=
on-radiobox-should-have-the-asso">Listbook AddPage raise the error: C++ ass=
ertion "radiobox", Should have the assoiciate radio box</a><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxpy=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxpython-users/f43a06d4-b005-495d-be00-f519ccc6aa50n%40googlegro=
ups.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d=
/msgid/wxpython-users/f43a06d4-b005-495d-be00-f519ccc6aa50n%40googlegroups.=
com</a>.<br />
------=_Part_955_1226121923.1660550785029--
------=_Part_954_910794538.1660550785029--