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
a2251aad
Commit
a2251aad
authored
Mar 13, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #989712: Support using Tk without a mainloop.
parent
30c825c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
Lib/idlelib/run.py
Lib/idlelib/run.py
+16
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/idlelib/run.py
View file @
a2251aad
...
...
@@ -38,6 +38,21 @@ else:
return
s
warnings
.
formatwarning
=
idle_formatwarning_subproc
def
handle_tk_events
():
"""Process any tk events that are ready to be dispatched if tkinter
has been imported, a tcl interpreter has been created and tk has been
loaded."""
tkinter
=
sys
.
modules
.
get
(
'tkinter'
)
if
tkinter
and
tkinter
.
_default_root
:
# tkinter has been imported, an Tcl interpreter was created and
# tk has been loaded.
root
=
tkinter
.
_default_root
while
root
.
tk
.
dooneevent
(
tkinter
.
_tkinter
.
DONT_WAIT
):
# Process pending events.
pass
# Thread shared globals: Establish a queue between a subthread (which handles
# the socket) and the main thread (which runs user code), plus global
# completion, exit and interruptable (the main thread) flags:
...
...
@@ -93,6 +108,7 @@ def main(del_exitfunc=False):
try
:
seq
,
request
=
rpc
.
request_queue
.
get
(
block
=
True
,
timeout
=
0.05
)
except
queue
.
Empty
:
handle_tk_events
()
continue
method
,
args
,
kwargs
=
request
ret
=
method
(
*
args
,
**
kwargs
)
...
...
Misc/NEWS
View file @
a2251aad
...
...
@@ -24,6 +24,8 @@ Core and Builtins
Library
-------
-
Issue
#
989712
:
Support
using
Tk
without
a
mainloop
.
-
Issue
#
5219
:
Prevent
event
handler
cascade
in
IDLE
.
-
Issue
#
3835
:
Refuse
to
use
unthreaded
Tcl
in
threaded
Python
.
...
...
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