Code:
# --> Copied from Boa Constructor
#Boa:Frame:wxFrame2

from wxPython.wx import *
from wxPython.html import *

def create(parent):
    return wxFrame2(parent)

[wxID_WXFRAME2, wxID_WXFRAME2BUTTON2, wxID_WXFRAME2NOTEBOOK1, 
 wxID_WXFRAME2TEXTCTRL1, wxID_WXFRAME2TOOLBAR1, 
] = map(lambda _init_ctrls: wxNewId(), range(5))

class wxFrame2(wxFrame):
    def _init_coll_notebook1_Pages(self, parent):
        # generated method, don't edit

        parent.AddPage(imageId=-1, page=self.textCtrl1, select=True,
              text='Tab 1')

    def _init_utils(self):
        # generated method, don't edit
        pass

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wxFrame.__init__(self, id=wxID_WXFRAME2, name='', parent=prnt,
              pos=wxPoint(245, 119), size=wxSize(600, 411),
              style=wxCLIP_CHILDREN | wxDEFAULT_FRAME_STYLE, title='wxFrame2')
        self._init_utils()
        self.SetClientSize(wxSize(592, 384))

        self.toolBar1 = wxToolBar(id=wxID_WXFRAME2TOOLBAR1, name='toolBar1',
              parent=self, pos=wxPoint(0, 0), size=wxSize(592, 28),
              style=wxTB_HORIZONTAL | wxNO_BORDER)
        self.SetToolBar(self.toolBar1)

        self.button2 = wxButton(id=wxID_WXFRAME2BUTTON2, label='New',
              name='button2', parent=self.toolBar1, pos=wxPoint(0, 0),
              size=wxSize(75, 23), style=0)
        EVT_BUTTON(self.button2, wxID_WXFRAME2BUTTON2, self.OnButton2Button)

        self.notebook1 = wxNotebook(id=wxID_WXFRAME2NOTEBOOK1, name='notebook1',
              parent=self, pos=wxPoint(0, 28), size=wxSize(592, 356),
              style=wxCLIP_CHILDREN | wxNB_BOTTOM)

        self.textCtrl1 = wxTextCtrl(id=wxID_WXFRAME2TEXTCTRL1, name='textCtrl1',
              parent=self.notebook1, pos=wxPoint(0, 0), size=wxSize(584, 330),
              style=0, value='textCtrl1')

        self._init_coll_notebook1_Pages(self.notebook1)

    def __init__(self, parent):
        self._init_ctrls(parent)

    def OnButton2Button(self, event):
        self.editor = self.textCtrl1
        self.notebook1.AddPage(self.editor,'Another Tab')
        event.Skip()
        
    def OnButton1Button(self, event):
        event.Skip()
1 need a little help here:

1. I can't get the function to create a new notebook tab to work, I new tabs that act independently should be created when I hit the 'New' button, but what happened is three new tabs were created instead of one, and it doesnt act independently (eg. If I typed 'a' in a text box in first tab, it'll also appeared on the text bot on the other tabs.

2. How can I close the tabs and do some errors checking(text changed etc.).

That's for now thanks in advance.