Я не совсем уверен, в чем ваша проблема.
Вот очень быстрый макет из примера кода wx.
#!/usr/bin/env python
import wx
class FileCtrl(wx.FileCtrl):
def __init__(self, parent, id=wx.ID_ANY, defaultDirectory="",
defaultFilename="",
wildCard=wx.FileSelectorDefaultWildcardStr,
style=wx.FC_DEFAULT_STYLE,
# | wx.FC_OPEN
# | wx.FC_SAVE
# | wx.FC_MULTIPLE
# | wx.FC_NOSHOWHIDDEN
pos=wx.DefaultPosition, size=wx.DefaultSize, name="filectrl", log=None):
wx.FileCtrl.__init__(self, parent, id, defaultDirectory, defaultFilename,
wildCard, style, pos, size, name)
self.Bind(wx.EVT_FILECTRL_FILEACTIVATED, self.OnFileActivated)
self.Bind(wx.EVT_FILECTRL_SELECTIONCHANGED, self.OnSelectionChanged)
self.Bind(wx.EVT_FILECTRL_FOLDERCHANGED, self.OnFolderChanged)
self.Bind(wx.EVT_FILECTRL_FILTERCHANGED, self.OnFilterChanged)
def OnFileActivated(self, event):
print('File Activated: %s\n' % event.GetFile())
def OnSelectionChanged(self, event):
print('Selection Changed: %s\n' % event.GetFile())
def OnFolderChanged(self, event):
print('Directory Changed: %s\n' % event.GetDirectory())
def OnFilterChanged(self, event):
print('Filter Changed: %s\n' % event.GetFilterIndex())
#---------------------------------------------------------------------------
class TestPanel(wx.Frame):
def __init__(self):
super().__init__(None)
self.panel = wx.Panel(self)
wx.StaticText(self.panel, -1,
"This is a generic control with features like a file dialog",
pos=(10,10))
fc = FileCtrl(self.panel, pos=(10,35))
fc.SetSize((500,350))
self.Show()
app = wx.App()
frame = TestPanel()
app.MainLoop()