Hi gurus,
I am newbeee in wxPython, I am making a wx.Notebook where one of the page(main panel) is having a small area of another vertical scrolled panel.
I tried few ideas it didn't work.... please help me on that.
below is the code
the class Ctrl is used to hook as a page in the notebook
so this is how it looks like. if you can please provide me any examples
|---------|-----------|
|Page1|Page2 |----------------------------------------|
|- -|-----------------------------------------------------|
| wx.Panel(main) |
| |
| |-----------------|v| |
| | wx.Scroll | | |
| | Panel | | |
| |-----------------|^| |
| |
|---------------------------------------------------------------|
Class Ctrl(wx.Panel):
Code:databaseList = ['12','13','14','15'] name_=None ID_=0 parent_=None def __init__(self,parent): wx.Panel.__init__(self, parent, -1) self.parent_=parent.getObject() self.dbT1=wx.StaticText(self.parent_, -1, "Current:", (15,27.5)) self.dbC1=wx.Choice(self.parent_, -1, (125,25), choices = self.databaseList) self.dbC1.Bind(wx.EVT_CHOICE, self.evtChoice, self.dbC1) self.dbC1.SetToolTipString("Select a DataBase from the List") self.dbC1.SetSelection(0) self.initElementSelection() def evtChoice(self,event): dbIdx=self.dbC1.GetCurrentSelection() print self.databaseList[dbIdx]+" Database is selected" def initElementSelection(self): elementPanel(self.parent_) class elementPanel(scroll.ScrolledPanel): def __init__(self,parent): #*************************************Trial 1 #sp=scroll.ScrolledPanel(parent,id=-1,pos=(50,50),size=(100,75)) #sp.SetupScrolling() #sizer=wx.BoxSizer(wx.VERTICAL) #sp.SetSizer(sizer) #*************************************Trial 1 END #*************************************Trial 2 wx.Panel.__init__(self,parent,-1) sp=self sp.SetPosition((100,100)) sp.Show() self.dbT1=wx.StaticText(self, -1, "I am Here:", (15,27.5)) #*************************************Trial 2 END


Reply With Quote

Bookmarks