Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. self.splitter = wx.SplitterWindow(self, id = wx.ID_ANY)
  2. self.panel1 = wx.Panel(self.splitter, id = wx.ID_ANY)
  3. self.panel2 = wx.Panel(self.splitter, id = wx.ID_ANY)
  4. self.panel1.SetBackgroundColour(wx.LIGHT_GREY)
  5. self.splitter.SplitHorizontally(self.panel1, self.panel2)
  6.  
  7. def displayNodes(self,event):
  8. if hasattr(self, "notebook") == False: #If the notebook object has not been already created
  9. #create notebook if it does not exitst already. This script should be present in every event handler
  10. self.panel = wx.Panel(self,wx.ID_ANY)
  11. self.notebook = NotebookDemo(self.panel)
  12. #creating vertical sizer for the notebook
  13. self.sizer = wx.BoxSizer(wx.VERTICAL)
  14. self.sizer.Add(self.notebook, 1, wx.ALL|wx.EXPAND, 5)
  15. self.panel.SetSizer(self.sizer)
  16. self.nodesname = "nodes"
  17. self.nodesinstance = wx.SingleInstanceChecker(self.nodesname)
  18. if self.nodesinstance.IsAnotherRunning():
  19. self.notebook.ChangeSelection(self.nodesindex)
  20. else:
  21. #creating a tab
  22. self.nodesTab = TabPanel(self.notebook)
  23. self.notebook.AddPage(self.nodesTab, "List of all the nodes")
  24. self.nodes = wx.ListBox(self.nodesTab, 11, (10,40), (200,130), self.nodeslist, wx.LB_SINGLE)
  25. self.nodesindex = self.notebook.GetPageCount() - 1
  26. self.notebook.SetSelection(self.nodesindex)
  27. #self.Bind(wx.EVT_CONTEXT_MENU, self.OnShowPopup)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement