Home | Trees | Indices | Help |
|
---|
|
1 ## vim:ts=4:et:nowrap 2 ## 3 ##---------------------------------------------------------------------------## 4 ## 5 ## PySol -- a Python Solitaire game 6 ## 7 ## Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer 8 ## Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer 9 ## Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer 10 ## Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer 11 ## Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer 12 ## Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer 13 ## All Rights Reserved. 14 ## 15 ## This program is free software; you can redistribute it and/or modify 16 ## it under the terms of the GNU General Public License as published by 17 ## the Free Software Foundation; either version 2 of the License, or 18 ## (at your option) any later version. 19 ## 20 ## This program is distributed in the hope that it will be useful, 21 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 22 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 ## GNU General Public License for more details. 24 ## 25 ## You should have received a copy of the GNU General Public License 26 ## along with this program; see the file COPYING. 27 ## If not, write to the Free Software Foundation, Inc., 28 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 29 ## 30 ## Markus F.X.J. Oberhumer 31 ## <markus@oberhumer.com> 32 ## http://www.oberhumer.com/pysol 33 ## 34 ##---------------------------------------------------------------------------## 35 36 37 # imports 38 import os, sys, string, types 39 import Tkinter, Canvas 40 41 42 # /*********************************************************************** 43 # // patch lib-tk/Tkinter.py 44 # ************************************************************************/ 45 46 # ignore self.tk.deletecommand() failures in Misc.destroy, or else the 47 # destruction of a (withdrawn & transient) toplevel may fail somewhere 48 # in the middle, possibly making Tk hang under Windows50 if self._tclCommands is not None: 51 for name in self._tclCommands: 52 try: 53 self.tk.deletecommand(name) 54 #print '- Tkinter: deleted command', name 55 except: 56 pass 57 self._tclCommands = None58 59 # fix Python 1.5.2 _tagcommands bug61 return self._bind((self._w, "bind", tagOrId), sequence, func, add)62 63 #65 if not args: 66 return self._getdoubles(self.tk.call(self._w, 'xview')) 67 if args[0] == "moveto": 68 return self.xview_moveto(float(args[1])) 69 elif args[0] == "scroll": 70 return self.xview_scroll(int(args[1]), args[2])75 if number < 0: 76 v = self._getdoubles(self.tk.call(self._w, 'xview')) 77 if v[0] <= 0.0001: 78 return 79 return self.tk.call(self._w, 'xview', 'scroll', number, what)81 if not args: 82 return self._getdoubles(self.tk.call(self._w, 'yview')) 83 if args[0] == "moveto": 84 return self.yview_moveto(float(args[1])) 85 elif args[0] == "scroll": 86 return self.yview_scroll(int(args[1]), args[2])91 if number < 0: 92 v = self._getdoubles(self.tk.call(self._w, 'yview')) 93 if v[0] <= 0.0001: 94 return 95 return self.tk.call(self._w, 'yview', 'scroll', number, what)96 97 # fix missing "newstate" parm 100 101 # these are missing in class Text (probably some others as well) 110 111 112 Tkinter.Misc.destroy = Misc__destroy 113 Tkinter.Canvas.tag_bind = Canvas__tag_bind 114 Tkinter.Canvas.xview = Canvas__xview 115 Tkinter.Canvas.xview_moveto = Canvas__xview_moveto 116 Tkinter.Canvas.xview_scroll = Canvas__xview_scroll 117 Tkinter.Canvas.yview = Canvas__yview 118 Tkinter.Canvas.yview_moveto = Canvas__yview_moveto 119 Tkinter.Canvas.yview_scroll = Canvas__yview_scroll 120 Tkinter.Wm.wm_state = Wm__wm_state 121 Tkinter.Wm.state = Wm__wm_state # obsolete 122 Tkinter.Text.xview_moveto = Text__xview_moveto 123 Tkinter.Text.xview_scroll = Text__xview_scroll 124 Tkinter.Text.yview_moveto = Text__yview_moveto 125 Tkinter.Text.yview_scroll = Text__yview_scroll 126 127 128 # /*********************************************************************** 129 # // patch lib-tk/Canvas.py 130 # ************************************************************************/ 131 132 # fix inconsistent bbox() return value 137 138 # fix missing "add" parm 143 144 # fix missing "funcid" parm146 return self.canvas.tag_unbind(self.id, sequence, funcid)148 return self.canvas.tag_unbind(self.id, sequence, funcid)149 150 # call tag_raise / tag_lower152 return self.canvas.tag_raise(self.id, abovethis)154 return self.canvas.tag_lower(self.id, belowthis)156 return self.canvas.tag_raise(self.id, abovethis)158 return self.canvas.tag_lower(self.id, belowthis)159 160 161 # other problems in Canvas.Group: 162 # - inconsistent usage of self.id and self.tag 163 # - calls the obsolete Tkinter.Canvas._do method 164 165 166 Canvas.CanvasItem.bbox = CanvasItem__bbox 167 Canvas.Group.bbox = Group__bbox 168 Canvas.CanvasItem.bind = CanvasItem__bind 169 Canvas.Group.bind = Group__bind 170 Canvas.CanvasItem.unbind = CanvasItem__unbind 171 Canvas.Group.unbind = Group__unbind 172 Canvas.CanvasItem.tkraise = CanvasItem__tkraise 173 Canvas.CanvasItem.lower = CanvasItem__lower 174 Canvas.Group.tkraise = Group__tkraise 175 Canvas.Group.lower = Group__lower 176 177 178 # /*********************************************************************** 179 # // PySol extra patches 180 # ************************************************************************/ 181 182 # do not catch any exceptions in a Tkinter callback 187 188 Tkinter.CallWrapper.__call__ = CallWrapper____call__ 189
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Aug 19 16:48:42 2009 | http://epydoc.sourceforge.net |