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
a3c3f2c5
Commit
a3c3f2c5
authored
Feb 07, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use PyCallable_Check; export TK_VERSION and TCL_VERSION strings;
some Tk 4.0 specific changes
parent
3fdf58b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
Modules/_tkinter.c
Modules/_tkinter.c
+19
-7
No files found.
Modules/_tkinter.c
View file @
a3c3f2c5
...
...
@@ -194,10 +194,16 @@ int
Tcl_AppInit
(
interp
)
Tcl_Interp
*
interp
;
{
if
(
Tcl_Init
(
interp
)
==
TCL_ERROR
)
Tk_Window
main
;
main
=
Tk_MainWindow
(
interp
);
if
(
Tcl_Init
(
interp
)
==
TCL_ERROR
)
{
fprintf
(
stderr
,
"Tcl_Init error: %s
\n
"
,
interp
->
result
);
return
TCL_ERROR
;
if
(
Tk_Init
(
interp
)
==
TCL_ERROR
)
}
if
(
Tk_Init
(
interp
)
==
TCL_ERROR
)
{
fprintf
(
stderr
,
"Tk_Init error: %s
\n
"
,
interp
->
result
);
return
TCL_ERROR
;
}
return
TCL_OK
;
}
#endif
/* !WITH_APPINIT */
...
...
@@ -699,8 +705,7 @@ Tkapp_CreateCommand (self, args)
if
(
!
PyTuple_Check
(
args
)
||
!
(
PyTuple_Size
(
args
)
==
2
)
||
!
PyString_Check
(
PyTuple_GetItem
(
args
,
0
))
||
!
(
PyMethod_Check
(
PyTuple_GetItem
(
args
,
1
))
||
PyFunction_Check
(
PyTuple_GetItem
(
args
,
1
))))
||
!
PyCallable_Check
(
PyTuple_GetItem
(
args
,
1
)))
{
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list"
);
return
NULL
;
...
...
@@ -813,7 +818,7 @@ Tkapp_CreateFileHandler (self, args)
id
=
GetFileNo
(
file
);
if
(
id
<
0
)
return
NULL
;
if
(
!
(
PyMethod_Check
(
func
)
||
PyFunction_Check
(
func
)
))
if
(
!
PyCallable_Check
(
func
))
{
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list"
);
return
NULL
;
...
...
@@ -982,8 +987,7 @@ Tkapp_CreateTimerHandler (self, args)
if
(
!
PyArg_Parse
(
args
,
"(iO)"
,
&
milliseconds
,
&
func
))
return
NULL
;
if
(
!
(
PyMethod_Check
(
func
)
||
PyFunction_Check
(
func
)
||
PyCFunction_Check
(
func
)))
if
(
!
PyCallable_Check
(
func
))
{
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list"
);
return
NULL
;
...
...
@@ -1191,6 +1195,7 @@ static PyMethodDef moduleMethods[] =
{
NULL
,
NULL
}
};
#undef WITH_READLINE
/* XXX */
#ifdef WITH_READLINE
static
int
EventHook
()
...
...
@@ -1211,9 +1216,12 @@ EventHook ()
static
void
Tkinter_Cleanup
()
{
/* This segfault with Tk 4.0 beta and seems unnecessary there as well */
#if TK_MAJOR_VERSION < 4
/* XXX rl_deprep_terminal is static, damned! */
while
(
tkMainWindowList
!=
0
)
Tk_DestroyWindow
(
tkMainWindowList
->
win
);
#endif
}
void
...
...
@@ -1250,6 +1258,10 @@ PyInit_tkinter ()
PyDict_SetItemString
(
d
,
"ALL_EVENTS"
,
v
);
v
=
Py_BuildValue
(
"i"
,
TK_DONT_WAIT
);
PyDict_SetItemString
(
d
,
"DONT_WAIT"
,
v
);
v
=
Py_BuildValue
(
"s"
,
TK_VERSION
);
PyDict_SetItemString
(
d
,
"TK_VERSION"
,
v
);
v
=
Py_BuildValue
(
"s"
,
TCL_VERSION
);
PyDict_SetItemString
(
d
,
"TCL_VERSION"
,
v
);
#ifdef WITH_READLINE
rl_event_hook
=
EventHook
;
...
...
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