]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | import wx |
2 | ||
3 | class ListBoxFrame(wx.Frame): | |
4 | def __init__(self): | |
5 | wx.Frame.__init__(self, None, -1, 'List Box Example', | |
6 | size=(250, 200)) | |
7 | panel = wx.Panel(self, -1) | |
8 | ||
9 | sampleList = ['zero', 'one', 'two', 'three', 'four', 'five', | |
10 | 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', | |
11 | 'twelve', 'thirteen', 'fourteen'] | |
12 | ||
13 | listBox = wx.ListBox(panel, -1, (20, 20), (80, 120), sampleList, | |
14 | wx.LB_SINGLE) | |
15 | listBox.SetSelection(3) | |
16 | ||
17 | if __name__ == '__main__': | |
18 | app = wx.PySimpleApp() | |
19 | ListBoxFrame().Show() | |
20 | app.MainLoop() | |
21 |