Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. from wx.lib.combotreebox import ComboTreeBox
  2. import wx
  3. import string
  4.  
  5.  
  6. class MyFrame(wx.Frame):
  7.  
  8. def __init__(self, parent):
  9. wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Combo Tree Test", pos=wx.Point(-1, -1),
  10. size=wx.Size(400, 40), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
  11.  
  12. combo = ComboTreeBox(self)
  13. ascii_list = list(string.ascii_uppercase)
  14. tld_list = ['ace', 'bob', 'cat', 'zed', 'dog']
  15.  
  16. for xl in ascii_list:
  17. item = combo.Append(xl) # Add a root item
  18.  
  19. for xl2 in tld_list:
  20. upperlist = xl2.upper().split()[0][0]
  21. if upperlist == xl:
  22. combo.Append(xl2, parent=item)
  23.  
  24. if __name__ == "__main__":
  25. app = wx.App(False)
  26. frame = MyFrame(None)
  27. frame.Show(True)
  28. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement