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
6716d60c
Commit
6716d60c
authored
Jul 30, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22085: Dropped support of Tk 8.3 in Tkinter.
parent
f44611ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
31 deletions
+19
-31
Lib/tkinter/__init__.py
Lib/tkinter/__init__.py
+4
-5
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_tkinter.c
Modules/_tkinter.c
+13
-26
No files found.
Lib/tkinter/__init__.py
View file @
6716d60c
...
@@ -245,7 +245,7 @@ class Variable:
...
@@ -245,7 +245,7 @@ class Variable:
Return the name of the callback.
Return the name of the callback.
"""
"""
cbname = self._master._register(callback)
cbname = self._master._register(callback)
self._tk.call("
trace
", "
variable
", self._name, mode, cbname)
self._tk.call("
trace
", "
add
", "
variable
", self._name, mode, cbname)
return cbname
return cbname
trace = trace_variable
trace = trace_variable
def trace_vdelete(self, mode, cbname):
def trace_vdelete(self, mode, cbname):
...
@@ -254,12 +254,12 @@ class Variable:
...
@@ -254,12 +254,12 @@ class Variable:
MODE is one of "r", "
w
", "u" for read, write, undefine.
MODE is one of "r", "
w
", "u" for read, write, undefine.
CBNAME is the name of the callback returned from trace_variable or trace.
CBNAME is the name of the callback returned from trace_variable or trace.
"""
"""
self._tk.call("
trace
", "
vdelet
e
", self._name, mode, cbname)
self._tk.call("
trace
", "
remove
", "
variabl
e
", self._name, mode, cbname)
self._master.deletecommand(cbname)
self._master.deletecommand(cbname)
def trace_vinfo(self):
def trace_vinfo(self):
"""Return all trace callback information."""
"""Return all trace callback information."""
return [self._tk.split(x) for x in self._tk.splitlist(
return [self._tk.split(x) for x in self._tk.splitlist(
self._tk.call("
trace
", "
vinfo
", self._name))]
self._tk.call("
trace
", "
info
", "
variable
", self._name))]
def __eq__(self, other):
def __eq__(self, other):
"""Comparison for equality (==).
"""Comparison for equality (==).
...
@@ -3789,8 +3789,7 @@ class PanedWindow(Widget):
...
@@ -3789,8 +3789,7 @@ class PanedWindow(Widget):
def _test():
def _test():
root = Tk()
root = Tk()
text = "
This
is
Tcl
/
Tk
version
%
s
" % TclVersion
text = "
This
is
Tcl
/
Tk
version
%
s
" % TclVersion
if TclVersion >= 8.1:
text += "
\
nThis
should
be
a
cedilla
:
\
xe7
"
text += "
\
nThis
should
be
a
cedilla
:
\
xe7
"
label = Label(root, text=text)
label = Label(root, text=text)
label.pack()
label.pack()
test = Button(root, text="
Click
me
!
",
test = Button(root, text="
Click
me
!
",
...
...
Misc/NEWS
View file @
6716d60c
...
@@ -113,6 +113,8 @@ Core and Builtins
...
@@ -113,6 +113,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22085: Dropped support of Tk 8.3 in Tkinter.
- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
In particular this allows to initialize images from binary data.
...
...
Modules/_tkinter.c
View file @
6716d60c
...
@@ -9,8 +9,8 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -9,8 +9,8 @@ Copyright (C) 1994 Steen Lumholt.
/* TCL/TK VERSION INFO:
/* TCL/TK VERSION INFO:
Only Tcl/Tk 8.
3.1
and later are supported. Older versions are not
Only Tcl/Tk 8.
4
and later are supported. Older versions are not
supported. Use Python
2.6
or older if you cannot upgrade your
supported. Use Python
3.4
or older if you cannot upgrade your
Tcl/Tk libraries.
Tcl/Tk libraries.
*/
*/
...
@@ -36,13 +36,6 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -36,13 +36,6 @@ Copyright (C) 1994 Steen Lumholt.
#define CHECK_SIZE(size, elemsize) \
#define CHECK_SIZE(size, elemsize) \
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
/* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
making _tkinter correct for this API means to break earlier
versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
earlier versions. Once Tcl releases before 8.4 don't need to be supported
anymore, this should go. */
#define USE_COMPAT_CONST
/* If Tcl is compiled for threads, we must also define TCL_THREAD. We define
/* If Tcl is compiled for threads, we must also define TCL_THREAD. We define
it always; if Tcl is not threaded, the thread functions in
it always; if Tcl is not threaded, the thread functions in
Tcl are empty. */
Tcl are empty. */
...
@@ -58,15 +51,8 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -58,15 +51,8 @@ Copyright (C) 1994 Steen Lumholt.
#include "tkinter.h"
#include "tkinter.h"
/* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */
#if TK_VERSION_HEX < 0x08040002
#ifndef CONST84_RETURN
#error "Tk older than 8.4 not supported"
#define CONST84_RETURN
#undef CONST
#define CONST
#endif
#if TK_VERSION_HEX < 0x08030102
#error "Tk older than 8.3.1 not supported"
#endif
#endif
#if !(defined(MS_WINDOWS) || defined(__CYGWIN__))
#if !(defined(MS_WINDOWS) || defined(__CYGWIN__))
...
@@ -376,10 +362,10 @@ unicodeFromTclObj(Tcl_Obj *value)
...
@@ -376,10 +362,10 @@ unicodeFromTclObj(Tcl_Obj *value)
static
PyObject
*
static
PyObject
*
Split
(
char
*
list
)
Split
(
c
onst
c
har
*
list
)
{
{
int
argc
;
int
argc
;
char
**
argv
;
c
onst
c
har
**
argv
;
PyObject
*
v
;
PyObject
*
v
;
if
(
list
==
NULL
)
{
if
(
list
==
NULL
)
{
...
@@ -481,7 +467,7 @@ SplitObj(PyObject *arg)
...
@@ -481,7 +467,7 @@ SplitObj(PyObject *arg)
}
}
else
if
(
PyUnicode_Check
(
arg
))
{
else
if
(
PyUnicode_Check
(
arg
))
{
int
argc
;
int
argc
;
char
**
argv
;
c
onst
c
har
**
argv
;
char
*
list
=
PyUnicode_AsUTF8
(
arg
);
char
*
list
=
PyUnicode_AsUTF8
(
arg
);
if
(
list
==
NULL
||
if
(
list
==
NULL
||
...
@@ -496,7 +482,7 @@ SplitObj(PyObject *arg)
...
@@ -496,7 +482,7 @@ SplitObj(PyObject *arg)
}
}
else
if
(
PyBytes_Check
(
arg
))
{
else
if
(
PyBytes_Check
(
arg
))
{
int
argc
;
int
argc
;
char
**
argv
;
c
onst
c
har
**
argv
;
char
*
list
=
PyBytes_AsString
(
arg
);
char
*
list
=
PyBytes_AsString
(
arg
);
if
(
Tcl_SplitList
((
Tcl_Interp
*
)
NULL
,
list
,
&
argc
,
&
argv
)
!=
TCL_OK
)
{
if
(
Tcl_SplitList
((
Tcl_Interp
*
)
NULL
,
list
,
&
argc
,
&
argv
)
!=
TCL_OK
)
{
...
@@ -563,8 +549,9 @@ static void EnableEventHook(void); /* Forward */
...
@@ -563,8 +549,9 @@ static void EnableEventHook(void); /* Forward */
static
void
DisableEventHook
(
void
);
/* Forward */
static
void
DisableEventHook
(
void
);
/* Forward */
static
TkappObject
*
static
TkappObject
*
Tkapp_New
(
char
*
screenName
,
char
*
className
,
Tkapp_New
(
const
char
*
screenName
,
const
char
*
className
,
int
interactive
,
int
wantobjects
,
int
wantTk
,
int
sync
,
char
*
use
)
int
interactive
,
int
wantobjects
,
int
wantTk
,
int
sync
,
const
char
*
use
)
{
{
TkappObject
*
v
;
TkappObject
*
v
;
char
*
argv0
;
char
*
argv0
;
...
@@ -1857,7 +1844,7 @@ Tkapp_SplitList(PyObject *self, PyObject *args)
...
@@ -1857,7 +1844,7 @@ Tkapp_SplitList(PyObject *self, PyObject *args)
{
{
char
*
list
;
char
*
list
;
int
argc
;
int
argc
;
char
**
argv
;
c
onst
c
har
**
argv
;
PyObject
*
arg
,
*
v
;
PyObject
*
arg
,
*
v
;
int
i
;
int
i
;
...
@@ -1984,7 +1971,7 @@ PythonCmd_Error(Tcl_Interp *interp)
...
@@ -1984,7 +1971,7 @@ PythonCmd_Error(Tcl_Interp *interp)
* function or method.
* function or method.
*/
*/
static
int
static
int
PythonCmd
(
ClientData
clientData
,
Tcl_Interp
*
interp
,
int
argc
,
char
*
argv
[])
PythonCmd
(
ClientData
clientData
,
Tcl_Interp
*
interp
,
int
argc
,
c
onst
c
har
*
argv
[])
{
{
PythonCmd_ClientData
*
data
=
(
PythonCmd_ClientData
*
)
clientData
;
PythonCmd_ClientData
*
data
=
(
PythonCmd_ClientData
*
)
clientData
;
PyObject
*
func
,
*
arg
,
*
res
;
PyObject
*
func
,
*
arg
,
*
res
;
...
...
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