2 from wxPython
.wx
import *
3 from wxPython
.lib
.filebrowsebutton
import FileBrowseButton
, FileBrowseButtonWithHistory
6 #----------------------------------------------------------------------
8 class TestPanel(wxPanel
):
9 def __init__(self
, parent
, ID
, log
):
10 wxPanel
.__init
__(self
, parent
, ID
)
12 self
.fbb
= FileBrowseButton(self
, -1, wxPoint(20,20), wxSize(450, -1),
13 changeCallback
= self
.fbbCallback
)
14 self
.fbbh
= FileBrowseButtonWithHistory(self
, -1, wxPoint(20, 50),
16 #changeCallback = self.fbbhCallback
19 self
.fbbh
.SetHistory(['You', 'can', 'put', 'some', 'file', 'names', 'here'])
22 def fbbCallback(self
, evt
):
23 self
.log
.write('FileBrowseButton: %s\n' % evt
.GetString())
26 def fbbhCallback(self
, evt
):
27 if hasattr(self
, 'fbbh'):
28 value
= evt
.GetString()
29 self
.log
.write('FileBrowseButtonWithHistory: %s\n' % value
)
30 history
= self
.fbbh
.GetHistory()
32 self
.fbbh
.SetHistory(history
)
35 #----------------------------------------------------------------------
37 def runTest(frame
, nb
, log
):
38 win
= TestPanel(nb
, -1, log
)
43 #----------------------------------------------------------------------
47 overview
= FileBrowseButton
.__doc
__