[Python-checkins] python/dist/src/Lib/lib-tk Tkinter.py,1.172,1.173

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 16 Apr 2003 13:10:14 -0700


Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory sc8-pr-cvs1:/tmp/cvs-serv8203

Modified Files:
	Tkinter.py 
Log Message:
Add 'get' method to Variable and switch it from internal class to
standard class (it is now useful because it doesn't constrain the type
of the value).


Index: Tkinter.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** Tkinter.py	16 Apr 2003 19:42:51 -0000	1.172
--- Tkinter.py	16 Apr 2003 20:10:03 -0000	1.173
***************
*** 164,168 ****
  _varnum = 0
  class Variable:
!     """Internal class. Base class to define value holders for e.g. buttons."""
      _default = ""
      def __init__(self, master=None):
--- 164,171 ----
  _varnum = 0
  class Variable:
!     """Class to define value holders for e.g. buttons.
! 
!     Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
!     that constrain the type of the value returned from get()."""
      _default = ""
      def __init__(self, master=None):
***************
*** 187,190 ****
--- 190,196 ----
          """Set the variable to VALUE."""
          return self._tk.globalsetvar(self._name, value)
+     def get(self):
+         """Return value of variable."""
+         return self._tk.globalgetvar(self._name)
      def trace_variable(self, mode, callback):
          """Define a trace callback for the variable.