From: Phil E. <ph...@li...> - 2006-08-13 18:02:10
|
On Sunday 13 Aug 2006 07:10, Kevin Altis wrote: > On Aug 12, 2006, at 3:41 PM, hwphillips wrote: > > How do you select a notebook page, other than with the mouse. I load 3 > > pages and when the program runs, the last page is selected. I would > > like > > to default to the first page but can't figure out how to do it. > > Thanks. > > Simply change the selection attribute of your notebook: > > self.components.notebook.selection = 0 > The other option is to do it when you create each page of the notebook, for example assuming you have a notebook component called 'myNotebook' and you want to add 4 tabs and end up with the 2nd tab selected, the relevant parts of the code would look like this: self.components.myNoteook.AddPage(tab1, 'Tab #1', False) self.components.myNoteook.AddPage(tab2, 'Tab #2', True) self.components.myNoteook.AddPage(tab3, 'Tab #3', False) self.components.myNoteook.AddPage(tab4, 'Tab #4', False) It's the True/False parameter on the end which governs which tab is made 'active'. -- Regards Phil Edwards Brighton, UK |