Hi, I'm having some problems with FlatNotebook.py and i hope you can help me. I'm sure that is very easy for an experinced user but i can't figured it out, i just start using wxpython.
The problem is that i don't know how to put diferent king of widgets on every notebook page. For example when i select page1, I want ot see three checkboxes and one button and when i select page2 two buttons and ten radio buttons, all in different positions than the previous page. Considering I have the following sample code how can i do that:
#code
#end code
In conclusion i want to show different widgets on different notebook pages and of course bind an event to every widget.
Thank you.
The problem is that i don't know how to put diferent king of widgets on every notebook page. For example when i select page1, I want ot see three checkboxes and one button and when i select page2 two buttons and ten radio buttons, all in different positions than the previous page. Considering I have the following sample code how can i do that:
#code
Code:
import wx
import FlatNotebook as FNB
import random
class MenuEventFrame(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id, 'Menus', size=(450, 200), pos=(500,400))
self.panel=wx.Panel (self, -1)
#self.panel.SetBackgroundColour ("white")
menuBar = wx.MenuBar()
menu1 = wx.Menu()
menuItem = menu1.Append(-1, "&Exit...")
menuBar.Append(menu1, "&File")
self.SetMenuBar(menuBar)
dd="Page1"
dd1="Page2"
dd2="Page3"
caption = "test"
stil = FNB.FNB_VC8 | FNB.FNB_DROPDOWN_TABS_LIST | FNB.FNB_TABS_BORDER_SIMPLE | FNB.FNB_BACKGROUND_GRADIENT
self.book = FNB.FlatNotebook(self, wx.ID_ANY, style=stil)
self.book.SetTabAreaColour(wx.Color(0,153,204))
self.book.AddPage(self.panel, dd, True, -1)
self.book.AddPage(self.panel, dd1, True, -1)
self.book.AddPage(self.panel, dd2, True, -1)
self.book.SetSelection(1)
def CreatePage(self, caption):
p = wx.Panel(self.book)
wx.StaticText(p, -1, caption, (20,20))
wx.TextCtrl(p, -1, "", (20,40), (150,-1))
p.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE))
return p
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MenuEventFrame(parent=None, id=-1)
frame.Show()
app.MainLoop()
In conclusion i want to show different widgets on different notebook pages and of course bind an event to every widget.
Thank you.
Comment