From: Kevin A. <ka...@us...> - 2004-08-12 19:19:34
|
Update of /cvsroot/pythoncard/PythonCard/samples/doodle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16511/doodle Modified Files: doodle.py Log Message: dialog.py is now a thin wrapper around wx.lib.dialogs.py all dialog results now use DialogResults class instead of dictionary e.g. result.accepted instead of result['accepted'] see dialogs sample and other samples and tools for examples of change Index: doodle.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/doodle/doodle.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** doodle.py 26 Apr 2004 04:16:02 -0000 1.26 --- doodle.py 12 Aug 2004 19:18:51 -0000 1.27 *************** *** 46,61 **** def on_btnColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result['accepted']: ! self.components.bufOff.foregroundColor = result['color'] ! event.target.backgroundColor = result['color'] def openFile(self): result = dialog.openFileDialog(None, "Import which file?") ! if result['accepted']: ! path = result['paths'][0] os.chdir(os.path.dirname(path)) self.filename = path bmp = graphic.Bitmap(self.filename) ! self.components.bufOff.drawBitmap(bmp, 0, 0) def on_menuFileOpen_select(self, event): --- 46,61 ---- def on_btnColor_mouseClick(self, event): result = dialog.colorDialog(self) ! if result.accepted: ! self.components.bufOff.foregroundColor = result.color ! event.target.backgroundColor = result.color def openFile(self): result = dialog.openFileDialog(None, "Import which file?") ! if result.accepted: ! path = result.paths[0] os.chdir(os.path.dirname(path)) self.filename = path bmp = graphic.Bitmap(self.filename) ! self.components.bufOff.drawBitmap(bmp, (0, 0)) def on_menuFileOpen_select(self, event): *************** *** 69,74 **** path, filename = os.path.split(self.filename) result = dialog.saveFileDialog(None, "Save As", path, filename) ! if result['accepted']: ! path = result['paths'][0] fileType = graphic.bitmapType(path) print fileType, path --- 69,74 ---- path, filename = os.path.split(self.filename) result = dialog.saveFileDialog(None, "Save As", path, filename) ! if result.accepted: ! path = result.paths[0] fileType = graphic.bitmapType(path) print fileType, path |