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&nbsp;<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,&nbsp;<strong>I do not create any radiobo=
x</strong>.<br></div><div>#################################################=
</div><div>&nbsp; import GUI_API_Window1&nbsp;</div><div>&nbsp; class Featu=
reList(wx.Listbook):&nbsp;</div><div>&nbsp; &nbsp; def __init__(self, paren=
t):=20
    wx.Listbook.__init__(self, parent, size =3D (List_len,List_width), styl=
e =3D wx.LB_LEFT)&nbsp;</div><div><br></div><div>&nbsp; &nbsp;pages =3D [</=
div><div>&nbsp; &nbsp; &nbsp;(GUI_API_Window1.Common1(self), 'Common1'),</d=
iv><div>&nbsp; &nbsp; &nbsp;(GUI_API_Window2.Common2(self), 'Common2'),&nbs=
p;</div><div>&nbsp; &nbsp; &nbsp;(GUI_API_Window3.Common3(self), 'Common3')=
,</div><div>&nbsp; &nbsp; (GUI_API_Window4.Common4(self), 'Common4')
             ]&nbsp;</div><div>&nbsp;    for page, label in pages:&nbsp;</d=
iv><div>&nbsp; &nbsp; &nbsp; &nbsp; <font color=3D"#ff0000">self.AddPage(pa=
ge,label) # error</font></div><div><br></div><div>#########################=
########################<br></div><div>&nbsp;
 class GUIAPIMain(wx.Frame): # For GUI API Control&nbsp;</div><div>&nbsp; &=
nbsp; &nbsp;def __init__(self, parent, title):&nbsp;</div><div>&nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; wx.Frame.__init__(self, parent =3D parent, size =3D =
(APIList_len,APIList_width), title =3D&nbsp; &nbsp; &nbsp; &nbsp;title)&nbs=
p;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; panel =3D wx.Panel(self)&nb=
sp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Add the panel for featur=
e list with subpage and control panel&nbsp;</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; self.FeatureNotebook =3D FeatureList(self)&nbsp;</div><div>&n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; self.rightpanel =3D RightPanel(self)&nbsp;=
</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v_sizer =3D wx.BoxSizer(wx.VE=
RTICAL)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; h_sizer2 =3D wx.=
BoxSizer(wx.HORIZONTAL)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
h_sizer2.Add(self.FeatureNotebook)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; h_sizer2.Add(self.rightpanel)&nbsp;</div><div>&nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; v_sizer.Add(h_sizer2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; self.SetSizer(v_sizer)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; self.Show()<br></div><div><p>And one of window as below code:</p>##=
###GUI_API_Window1.py#####&nbsp;</div><div>class Common1(wx.Notebook):</div=
><div>&nbsp;
   def __init__(self, parent):&nbsp;</div><div>&nbsp; &nbsp; &nbsp; wx.Note=
book.__init__(self, parent =3D parent, id =3D wx.ID_ANY)&nbsp;</div><div>&n=
bsp; &nbsp; &nbsp; sizer =3D wx.BoxSizer(wx.VERTICAL)&nbsp;</div><div>&nbsp=
; &nbsp; &nbsp; self.Common1=3D wx.Notebook(self)&nbsp;</div><div>&nbsp; &n=
bsp; &nbsp; window1 =3D Common1Window1(self.Common1)&nbsp;</div><div>&nbsp;=
 &nbsp; &nbsp; window2 =3D Common1Window2(self.Common1)&nbsp;</div><div>&nb=
sp; &nbsp; &nbsp; self.Common1.AddPage(window1, 'Advanced settings 1', sele=
ct =3D True)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><di=
v>&nbsp; &nbsp; &nbsp; self.Common1.AddPage(window2, 'System Default', sele=
ct =3D False)&nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; size=
r.Add(self.Common1, 1, wx.EXPAND)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; self=
.SetSizer(sizer)&nbsp;<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&quot; 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--