Adding tabs to notebook using Boa Constructor

723 views Asked by At

I am having trouble using Boa Constructor, specifically in creating a GUI with a tabbed notebook. I cannot get the App to show the multiple tabs or the panels. I have made wx.App->wx.Frame->wx.Notebook and some panels within the notebook (as shown in the 'Objs' tab of the 'Inspector'.

I have been looking at the example 'Examples\advanced\FramePanels' from the boa folder and looking at the code I can see why it doesn't work. There is a function missing which seems to be generated by boa (as part of the Frame class):

_custom_classes = {'wx.Panel': ['wxPanel1', 'wxPanel2', 'wxPanel3']}
def _init_coll_notebook1_Pages(self, parent):
    # generated method, don't edit

    parent.AddPage(imageId=-1, page=self.panel1, select=False,
          text='Pages0')
    parent.AddPage(imageId=-1, page=self.panel2, select=True, text='Pages1')
    parent.AddPage(imageId=-1, page=self.panel3, select=False,
          text='Pages2')

There is also a line calling the function in the _init_ctrls section of the code. So my question is how can you get boa to add these lines of code?

From my reading I could code it manually, but I do not want to have to do that. My use of wxPython is just making several simple gui's for people who can't use CLI, so I want to streamline the process.

Thank you for your help

1

There are 1 answers

0
Artem Markov On

Every time changing or adding something new to gui form you need to:

  1. Press "Post the session" button in the inspector window;
  2. Press "Post" button in the editor window;
  3. Press "Refresh" button in the editor window;
  4. Save all files what are marked by star symbol.

However the better choice is to use wxFormBuilder because boa project is rather old and have been uncommitted for a long time. http://sourceforge.net/projects/wxformbuilder/