I'm attempting to create a custom dialog in wxPython that mimics the wx.MultiChoiceDialog, yet only differs in allowing a user to select all files with the selection of a single check box. This seemed to be a straight forward process, but I've not had success with the textCntrl, checkboxes, or populating the files. Any and all help and direction is appreciated. Thanks!
Below, is one of my many attempts:
import wx
class Extract_file(wx.Dialog):
def __init__(self, parent, title):
wx.Dialog.__init__(self, parent, title=title, size=(345, 337))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_RICH2)
wx.StaticText(self, -1, 'Files in c:\Extracted', (20,20))
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.HORIZONTAL)
chbox = wx.CheckBox(panel, -1, 'CheckBox')
sizer.Add(chbox, 0, wx.ALL, 10)
compute_btn = wx.Button(self, 1, 'Okay', (167, 272))
compute_btn.SetFocus()
clear_btn = wx.Button(self, 2, 'Cancel', (247, 272))
wx.EVT_BUTTON(self, 1, self.OnOkay)
wx.EVT_BUTTON(self, 2, self.OnQuit)
self.Centre()
self.ShowModal()
self.Destroy()
def OnOkay(self, event):
#do something
def OnQuit(self, event):
self.Close(True)
if __name__ == '__main__':
app = wx.App(False)
dlog = Extract_file(None, 'File Extraction')
app.MainLoop()