It’s not apparent to me how to execute a select all checkbox in a MultiChoice Dialog widget. Does anybody have any experience or can someone offer some direction in accomplishing this task? Thanks.
Below is working code for the dialog:
sampleList = []
for filename in filelist:
(head, filename) = os.path.split(filename)
if filename.endswith(".log") or filename.endswith(".txt"):
sampleList.append(filename)
dlg = wx.MultiChoiceDialog(
self, "Files in c:\Extracted", 'Local File Search',
sampleList,
wx.CHOICEDLG_STYLE
)
if dlg.ShowModal() == wx.ID_OK:
cur_item = dlg.GetSelections()
strings = [sampleList[x] for x in cur_item]
I don’t think that’s really possible with this kind of dialog. What you should do instead is create a custom dialog with the wx.Dialog class and put some checkbox widgets in it. To my knowledge, there is no way to attach wx.EVT_CHECKBOX to the checkbox’s in that default dialog.