]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/ImageBrowser.py
Switch to a read-only combobox
[wxWidgets.git] / wxPython / demo / ImageBrowser.py
1 #----------------------------------------------------------------------------
2 # Name: ImageBrowser.py
3 # Purpose: Image Selection dialog for wxPython demo
4 #
5 # Author: Lorne White (email: lorne.white@telusplanet.net)
6 #
7 # Version 0.5
8 # Date: Feb 26, 2001
9 # Licence: wxWindows license
10 #----------------------------------------------------------------------------
11 #
12 # 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net)
13 #
14 # o Updated for wx namespace
15 #
16 # 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net)
17 #
18 # o Library has to be updated, it is using obsolete names
19 # (wxPyDefaultSize, etc)
20 #
21
22 import os
23
24 import wx
25 import wx.lib.imagebrowser as ib
26 #---------------------------------------------------------------------------
27
28 def runTest(frame, nb, log):
29 # get current working directory
30 dir = os.getcwd()
31
32 # set the initial directory for the demo bitmaps
33 initial_dir = os.path.join(dir, 'bitmaps')
34
35 # open the image browser dialog
36 win = ib.ImageDialog(frame, initial_dir)
37
38 win.Centre()
39
40 if win.ShowModal() == wx.ID_OK:
41 # show the selected file
42 log.WriteText("You Selected File: " + win.GetFile())
43 else:
44 log.WriteText("You pressed Cancel\n")
45
46 win.Destroy()
47
48 #---------------------------------------------------------------------------
49
50
51 overview = """\
52 """
53
54 if __name__ == '__main__':
55 import sys,os
56 import run
57 run.main(['', os.path.basename(sys.argv[0])])
58