diff --git a/slic/gui/daqframe.py b/slic/gui/daqframe.py index b4f95813..6120bd0f 100644 --- a/slic/gui/daqframe.py +++ b/slic/gui/daqframe.py @@ -22,8 +22,7 @@ class DAQFrame(wx.Frame): notebook.AddPage(panel_static, "Static") notebook.AddPage(panel_scan, "Scan") - last_page = notebook.GetPageCount() - 1 # start on last page (Scan) - notebook.SetSelection(last_page) + panel_main.SetSelection(-1) # start on last page (Scan) # make sure the window is large enough sizer = wx.BoxSizer(wx.VERTICAL) diff --git a/slic/gui/widgets.py b/slic/gui/widgets.py index a925f3f1..a2b6e89c 100644 --- a/slic/gui/widgets.py +++ b/slic/gui/widgets.py @@ -26,6 +26,12 @@ class NotebookPanel(wx.Panel): #TODO: This needs work sizer.Add(notebook) self.SetSizer(sizer) + def SetSelection(self, num): + nb = self.notebook + ntotal = nb.GetPageCount() + num %= ntotal # allow counting from the back using negative numbers + nb.SetSelection(num) + # def __getattr__(self, name): # return getattr(self.notebook, name)