Listbook AddPage raise the error: C++ assertion "radiobox", Should have the assoiciate radio box

19 views
Skip to first unread message

羅祥友

unread,
Aug 15, 2022, 9:31:38 AM8/15/22
to wxPython-users
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) 

Reply all
Reply to author
Forward
0 new messages