All pastes #406060 Raw Edit

Something

public python v1 · immutable
·published 2007-03-22 03:22 UTC
rendered paste body
   def addFiles(self):        """Event handler for adding files to the list box"""#        self.tk.call('catch', '{tkFileDialog.askopenfilenames -with-invalid-argument}')        self.tk.call('namespace', 'eval', '::tk::dialog::file::{', 'variable', 'showHiddenBtn', 1, '}')        self.tk.call('namespace', 'eval', '::tk::dialog::file::{', 'variable', 'showHiddenVar', 0, '}')        self.tk.call('set', '::tk::dialog::file::showHiddenBtn',  '1')        self.tk.call('set', '::tk::dialog::file::showHiddenVar',  '0')        self.update_idletasks()        files = tkFileDialog.askopenfilenames(parent=self, title='Add files')        for file in files:            log.debug("Adding '%s' to the file list" % file)            self.lstFiles.insert('end', file)            # Add a dummy title (with pathname and extension removed)            title = os.path.basename(file)[0:-4]            self.lstMapped.insert('end', title)        self.updateUsage()        self.syncFilesList()