]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/ImageBrowser.py
1 #----------------------------------------------------------------------------
2 # Name: ImageBrowser.py
3 # Purpose: Image Selection dialog for wxPython demo
5 # Author: Lorne White (email: lorne.white@telusplanet.net)
9 # Licence: wxWindows license
10 #----------------------------------------------------------------------------
12 # 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net)
14 # o Updated for wx namespace
16 # 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net)
18 # o Library has to be updated, it is using obsolete names
19 # (wxPyDefaultSize, etc)
25 import wx
.lib
.imagebrowser
as ib
26 #---------------------------------------------------------------------------
28 def runTest(frame
, nb
, log
):
29 # get current working directory
32 # set the initial directory for the demo bitmaps
33 initial_dir
= os
.path
.join(dir, 'bitmaps')
35 # open the image browser dialog
36 win
= ib
.ImageDialog(frame
, initial_dir
)
40 if win
.ShowModal() == wx
.ID_OK
:
41 # show the selected file
42 log
.WriteText("You Selected File: " + win
.GetFile())
44 log
.WriteText("You pressed Cancel\n")
48 #---------------------------------------------------------------------------
54 if __name__
== '__main__':
57 run
.main(['', os
.path
.basename(sys
.argv
[0])])