Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from wx.lib.combotreebox import ComboTreeBox
- import wx
- import string
- class MyFrame(wx.Frame):
- def __init__(self, parent):
- wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Combo Tree Test", pos=wx.Point(-1, -1),
- size=wx.Size(400, 40), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
- combo = ComboTreeBox(self)
- ascii_list = list(string.ascii_uppercase)
- tld_list = ['ace', 'bob', 'cat', 'zed', 'dog']
- for xl in ascii_list:
- item = combo.Append(xl) # Add a root item
- for xl2 in tld_list:
- upperlist = xl2.upper().split()[0][0]
- if upperlist == xl:
- combo.Append(xl2, parent=item)
- if __name__ == "__main__":
- app = wx.App(False)
- frame = MyFrame(None)
- frame.Show(True)
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement