|
2 | 2 |
|
3 | 3 | Easy multithreading with Tkinter on CPython 2.7/3.x and PyPy 2.7/3.x. |
4 | 4 |
|
5 | | - import tkthread; tkthread.tkinstall() # do this before importing tkinter |
| 5 | + import tkthread; tkthread.patch() # do this before importing tkinter |
6 | 6 |
|
7 | 7 | ## Background |
8 | 8 |
|
@@ -39,11 +39,11 @@ it does not require the `Thread` package in Tcl. |
39 | 39 |
|
40 | 40 | ## Usage on CPython (simplest) |
41 | 41 |
|
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. |
45 | 45 |
|
46 | | - import tkthread; tkthread.tkinstall() |
| 46 | + import tkthread; tkthread.patch() |
47 | 47 | import tkinter as tk |
48 | 48 |
|
49 | 49 | root = tk.Tk() |
@@ -116,8 +116,10 @@ use `root` as the master. |
116 | 116 |
|
117 | 117 | ## API |
118 | 118 |
|
119 | | -- `tkthread.tkinstall()` |
| 119 | +- `tkthread.patch()` |
120 | 120 | - patch Tkinter to support multi-threading. |
| 121 | +- `tkthread.tkinstall()` |
| 122 | + - same as `.patch()` |
121 | 123 | - `tkthread.call(func, *args, **kw)` |
122 | 124 | - call `func` on the main thread, with arguments and keyword arguments. |
123 | 125 | - `@tkthread.called_on_main` |
@@ -145,7 +147,7 @@ On Debian/Ubuntu: |
145 | 147 | On Windows, you'll need to manually update your Tcl installation to include |
146 | 148 | the `Thread` package. |
147 | 149 |
|
148 | | -The simpler solution is to use `tkthread.tkinstall()` instead. |
| 150 | +The simpler solution is to use `tkthread.patch()` instead. |
149 | 151 |
|
150 | 152 |
|
151 | 153 | When using Matplotlib, you may receive a warning message that can be ignored: |
|
0 commit comments