]>
Commit | Line | Data |
---|---|---|
49875c53 RD |
1 | #---------------------------------------------------------------------------- |
2 | # Name: ImageBrowser.py | |
3 | # Purpose: Image Selection dialog for wxPython demo | |
4 | # | |
5 | # Author: Lorne White (email: lorne.white@telusplanet.net) | |
6 | # | |
1fded56b | 7 | # Version 0.5 |
49875c53 RD |
8 | # Date: Feb 26, 2001 |
9 | # Licence: wxWindows license | |
10 | #---------------------------------------------------------------------------- | |
8fa876ca RD |
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 | # | |
49875c53 | 21 | |
8fa876ca | 22 | import os |
49875c53 | 23 | |
8fa876ca RD |
24 | import wx |
25 | import wx.lib.imagebrowser as ib | |
49875c53 RD |
26 | #--------------------------------------------------------------------------- |
27 | ||
28 | def runTest(frame, nb, log): | |
8fa876ca RD |
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 | ||
49875c53 | 38 | win.Centre() |
8fa876ca RD |
39 | |
40 | if win.ShowModal() == wx.ID_OK: | |
41 | # show the selected file | |
42 | log.WriteText("You Selected File: " + win.GetFile()) | |
49875c53 RD |
43 | else: |
44 | log.WriteText("You pressed Cancel\n") | |
1fded56b | 45 | |
8fa876ca RD |
46 | win.Destroy() |
47 | ||
49875c53 RD |
48 | #--------------------------------------------------------------------------- |
49 | ||
50 | ||
49875c53 RD |
51 | overview = """\ |
52 | """ | |
1fded56b | 53 | |
1fded56b RD |
54 | if __name__ == '__main__': |
55 | import sys,os | |
56 | import run | |
57 | run.main(['', os.path.basename(sys.argv[0])]) | |
58 |