Hi folks,
I bother you again; this time I have a wxFrame containing a wxNotebook with a single page. On this page are two buttons. Why the focus can't be switched from button2 to button1 when pressing "Tab" (or from button1 to button 2 with "Shift-Tab")? Is there any workaround for this?
It has to do with the notebook because for a simple panel it works.
Thank you,
Cristina.
···
-------------------
from wxPython.wx import *
class MyFrame(wxFrame):
def __init__(self, parent):
wxFrame.__init__(self, parent, -1, "Test for Tab navigation on a Notebook", size=(400,200))
self.notebook = wxNotebook(self, -1, style=0)
self.pane = wxPanel(self.notebook, -1)
self.button1 = wxButton(self.pane, -1, "button1")
self.button2 = wxButton(self.pane, -1, "button2")
sizer = wxBoxSizer(wxVERTICAL)
sizer_3 = wxBoxSizer(wxVERTICAL)
sizer_3.Add(self.button1, 0, wxALL, 20)
sizer_3.Add(self.button2, 0, wxALL, 20)
self.pane.SetAutoLayout(1)
self.pane.SetSizer(sizer_3)
self.notebook.AddPage(self.pane, "tab1")
sizer.Add(wxNotebookSizer(self.notebook), 1, wxEXPAND, 0)
self.SetAutoLayout(1)
self.SetSizer(sizer)
self.Layout()
#---------------------------------------------------------------------------
if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = MyFrame(None)
frame.Show(true)
app.MainLoop()