Skip to content

Commit 48bcbca

Browse files
committed
issue 4: add patch reference to tkinstall
1 parent 47df61f commit 48bcbca

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Easy multithreading with Tkinter on CPython 2.7/3.x and PyPy 2.7/3.x.
44

5-
import tkthread; tkthread.tkinstall() # do this before importing tkinter
5+
import tkthread; tkthread.patch() # do this before importing tkinter
66

77
## Background
88

@@ -39,11 +39,11 @@ it does not require the `Thread` package in Tcl.
3939

4040
## Usage on CPython (simplest)
4141

42-
For CPython 2.7/3.x, `tkhread.tkinstall()` can be called first,
43-
and will patch Tkinter to re-route threaded calls to the Tcl interpreter
44-
using the `willdispatch` internal API call.
42+
For CPython 2.7/3.x, `tkthread.patch()` (same as `tkthread.tkinstall()`)
43+
can be called first, and will patch Tkinter to re-route threaded calls to the
44+
Tcl interpreter using the `willdispatch` internal API call.
4545

46-
import tkthread; tkthread.tkinstall()
46+
import tkthread; tkthread.patch()
4747
import tkinter as tk
4848

4949
root = tk.Tk()
@@ -116,8 +116,10 @@ use `root` as the master.
116116

117117
## API
118118

119-
- `tkthread.tkinstall()`
119+
- `tkthread.patch()`
120120
- patch Tkinter to support multi-threading.
121+
- `tkthread.tkinstall()`
122+
- same as `.patch()`
121123
- `tkthread.call(func, *args, **kw)`
122124
- call `func` on the main thread, with arguments and keyword arguments.
123125
- `@tkthread.called_on_main`
@@ -145,7 +147,7 @@ On Debian/Ubuntu:
145147
On Windows, you'll need to manually update your Tcl installation to include
146148
the `Thread` package.
147149

148-
The simpler solution is to use `tkthread.tkinstall()` instead.
150+
The simpler solution is to use `tkthread.patch()` instead.
149151

150152

151153
When using Matplotlib, you may receive a warning message that can be ignored:

tkthread/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def run(func):
107107
)
108108

109109
__all__ = ['TkThread', 'tk', '__version__',
110-
'tkinstall', 'main', 'current', 'call']
110+
'tkinstall', 'main', 'current', 'call', 'patch']
111+
112+
patch = tkinstall # Issue #4
111113

112114

113115
class _Result(object):

0 commit comments

Comments
 (0)