Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bfe175c1
Commit
bfe175c1
authored
Apr 16, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For StringVar results to strings. Document that boolean things are of
type bool. Requested in #721171.
parent
76ba09fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Lib/lib-tk/Tkinter.py
Lib/lib-tk/Tkinter.py
+7
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/lib-tk/Tkinter.py
View file @
bfe175c1
...
...
@@ -223,7 +223,10 @@ class StringVar(Variable):
def
get
(
self
):
"""Return value of variable as string."""
return
self
.
_tk
.
globalgetvar
(
self
.
_name
)
value
=
self
.
_tk
.
globalgetvar
(
self
.
_name
)
if
isinstance
(
value
,
basestring
):
return
value
return
str
(
value
)
class
IntVar
(
Variable
):
"""Value holder for integer variables."""
...
...
@@ -267,7 +270,7 @@ class BooleanVar(Variable):
Variable
.
__init__
(
self
,
master
)
def
get
(
self
):
"""Return the value of the variable as
0 or 1
."""
"""Return the value of the variable as
a bool
."""
return
self
.
_tk
.
getboolean
(
self
.
_tk
.
globalgetvar
(
self
.
_name
))
def
mainloop
(
n
=
0
):
...
...
@@ -369,7 +372,7 @@ class Misc:
getint
=
int
getdouble
=
float
def
getboolean
(
self
,
s
):
"""Return
0 or 1
for Tcl boolean values true and false given as parameter."""
"""Return
a boolean value
for Tcl boolean values true and false given as parameter."""
return
self
.
tk
.
getboolean
(
s
)
def
focus_set
(
self
):
"""Direct input focus to this widget.
...
...
@@ -1636,7 +1639,7 @@ class Pack:
anchor=NSEW (or subset) - position widget according to
given direction
before=widget - pack it before you will pack widget
expand=
1 or 0
- expand widget if parent size grows
expand=
bool
- expand widget if parent size grows
fill=NONE or X or Y or BOTH - fill widget if widget grows
in=master - use master to contain this widget
ipadx=amount - add internal padding in x direction
...
...
Misc/NEWS
View file @
bfe175c1
...
...
@@ -63,6 +63,9 @@ Core and builtins
Extension modules
-----------------
- Tkinter wrappers around Tcl variables now pass objects directly
to Tcl, instead of first converting them to strings.
- The .*? pattern in the re module is now special-cased to avoid the
recursion limit. (SF patch #720991 -- many thanks to Gary Herron
and Greg Chapman.)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment