]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/SingleChoiceDialog.py
fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl...
[wxWidgets.git] / wxPython / demo / SingleChoiceDialog.py
1
2 import wx
3
4 #---------------------------------------------------------------------------
5
6 def runTest(frame, nb, log):
7 dlg = wx.SingleChoiceDialog(
8 frame, 'Test Single Choice', 'The Caption',
9 ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'],
10 wx.CHOICEDLG_STYLE
11 )
12
13 if dlg.ShowModal() == wx.ID_OK:
14 log.WriteText('You selected: %s\n' % dlg.GetStringSelection())
15
16 dlg.Destroy()
17
18 #---------------------------------------------------------------------------
19
20
21
22
23 overview = """\
24 This class represents a dialog that shows a list of strings, and allows the user
25 to select one. Double-clicking on a list item is equivalent to single-clicking
26 and then pressing OK.
27
28 As with all dialogs, be sure to retrieve the information you need BEFORE you
29 destroy the dialog.
30 """
31
32
33
34 if __name__ == '__main__':
35 import sys,os
36 import run
37 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
38