Greetings everyone,
I'm currently working on an app using Python and wxPython. In it I have a Dialog where several fields are filled in order to insert a "document" in a database. The layout of that Dialog consists basically of a wx.Notebook, with several "tabs", each containing some sort of fields.
# Dialog class
class NovoRegisto(wx.Dialog):
def __init__(self,parent):
wx.Dialog.__init__(self, parent, title='Registar Nova O.T.', size=(900,600))
painel = wx.ScrolledWindow(self, -1, style=wx.VSCROLL|wx.HSCROLL)
painel.SetScrollbars(0,30,0,500)
notebook = wx.Notebook(painel)
# create the page windows as children of the notebook
pag1 = InfoOT(notebook)
pag2 = Avaliacao(notebook)
pag3 = Componentes(notebook)
pag4 = Material(notebook)
pag5 = OTsRelacionadas(notebook)
<...>
# function to insert data in SQLite database
def OnRegister(self,event):
<...>
# first tab class
class InfoOT(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
<...>
As you can see, I have a class for the Dialog itself (with a definition controlled by a "Register" button) and then a different class for each of the "tabs" of the notebook.
Now, in order to submit the data to the database, I must have access to the "tabs" variables in the "OnRegister" definition (which belongs to the Dialog's class). However, I still haven't found a way to do that.
Can anyone help me? Do I have to change my program's structure? I did it this way because it was the only way I managed to make the notebook work...
Thank you in advance