Created
July 1, 2013 20:52
-
-
Save chadcooper/5904534 to your computer and use it in GitHub Desktop.
Super simple file picker jobbie.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
class MyForm(wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self, None, wx.ID_ANY, "File Picker") | |
self.panel = wx.Panel(self, wx.ID_ANY) | |
box = wx.BoxSizer(wx.SB_VERTICAL) | |
self.file_picker = wx.FilePickerCtrl(self.panel, -1) | |
box.Add(self.file_picker, 0, wx.EXPAND) | |
self.panel.SetSizer(box) | |
self.Bind(wx.EVT_FILEPICKER_CHANGED, self.change_current, self.file_picker) | |
def change_current(self, event): | |
filename = self.file_picker.GetPath() | |
print filename | |
if __name__ == "__main__": | |
app = wx.App(False) | |
frame = MyForm() | |
frame.Show() | |
app.MainLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment