Tartalomjegyzék

< wxPython GUI

wxPython vágólap

Példa

notebook.py
import wx
 
 
class NamePanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
 
class DatePanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
 
 
 
class MainFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        wx.Frame.__init__(self, *args, **kwds)
        self.initUI()
        self.initLayout()
 
    def initUI(self):
        nb = wx.Notebook(self)
        name_panel = NamePanel(nb)
        date_panel = DatePanel(nb)
        nb.AddPage(name_panel, 'Nevek')
        nb.AddPage(date_panel, 'Dátumok')
 
    def initLayout(self):
        pass
 
class SimpleApp(wx.App):
    def OnInit(self):
        self.frame = MainFrame(None, wx.ID_ANY, "Notebook", size=(400, 300))
        self.SetTopWindow(self.frame)
        self.frame.Show()
        return True
 
if __name__ == "__main__":
    app = SimpleApp(None)
    app.MainLoop()

Másik panel eleme

self.GetParent().GetParent().lending_panel.guest_entry.SetValue('vmi')