summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed Py_PROTO, ANSI-fied sources.Fred Drake2000-07-081-187/+68
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* Patch from Michael Hudson to fix flatten recursive data structures:Andrew M. Kuchling2000-06-191-5/+8
| | | | | | | | | [mwh21@atrus build]$ ./python >>> import Tkinter >>> l = [] >>> l.append(l) >>> Tkinter._flatten(l) Segmentation fault (core dumped)
* Patch from /F:Andrew M. Kuchling2000-06-181-0/+100
| | | | | | | | | | this patch adds a fast _flatten function to the _tkinter module, and imports it from Tkinter.py (if available). this speeds up canvas operations like create_line and create_polygon. for example, a create_line with 5000 vertices runs about 50 times faster with this patch in place.
* When the UTF-8 conversion to Unicode fails, return an 8-bit stringGuido van Rossum2000-05-041-1/+5
| | | | | | | | | | instead. This seems more robust than returning an Unicode string with some unconverted charcters in it. This still doesn't support getting truly binary data out of Tcl, since we look for the trailing null byte; but the old (pre-Unicode) code did this too, so apparently there's no need. (Plus, I really don't feel like finding out how Tcl deals with this in each version.)
* Two changes to improve (I hope) Unicode support.Guido van Rossum2000-05-041-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. In Tcl 8.2 and later, use Tcl_NewUnicodeObj() when passing a Python Unicode object rather than going through UTF-8. (This function doesn't exist in Tcl 8.1, so there the original UTF-8 code is still used; in Tcl 8.0 there is no support for Unicode.) This assumes that Tcl_UniChar is the same thing as Py_UNICODE; a run-time error is issued if this is not the case. 2. In Tcl 8.1 and later (i.e., whenever Tcl supports Unicode), when a string returned from Tcl contains bytes with the top bit set, we assume it is encoded in UTF-8, and decode it into a Unicode string object. Notes: - Passing Unicode strings to Tcl 8.0 does not do the right thing; this isn't worth fixing. - When passing an 8-bit string to Tcl 8.1 or later that has bytes with the top bit set, Tcl tries to interpret it as UTF-8; it seems to fall back on Latin-1 for non-UTF-8 bytes. I'm not sure what to do about this besides telling the user to disambiguate such strings by converting them to Unicode (forcing the user to be explicit about the encoding). - Obviously it won't be possible to get binary data out of Tk this way. Do we need that ability? How to do it?
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-4/+4
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Marc-Andre Lemburg:Guido van Rossum2000-04-271-1/+3
| | | | Fixes a memory leak found by Fredrik Lundh.
* Add back an obscure "feature" to the Obj version of Tkapp_Call(): aGuido van Rossum2000-03-311-0/+4
| | | | | | None in an argument list *terminates* the argument list: further arguments are *ignored*. This isn't kosher, but too much code relies on it, implicitly. For example, IDLE was pretty broken.
* Don't use the object call interface in Tk 8.0 -- the EvalObj* APIGuido van Rossum2000-03-311-41/+164
| | | | | changed from 8.0 to 8.1 and I see no big reason to use objects in 8.0. At least now it works again with all versions from 8.0 - 8.3.
* The Tcl_Obj patch discussed on the patches list.Guido van Rossum2000-03-291-82/+77
| | | | | | | This was originally submitted by Martin von Loewis as part of his Unicode patch; all I did was add special cases for Python int and float objects and rearrange the object type tests somewhat to speed up the common cases (string, int, float, tuple, unicode, object).
* Patch by Neil Schemenauer to remove support for Tcl/Tk versions beforeGuido van Rossum2000-03-281-111/+21
| | | | | 8.0. There really is no excuse, and for who really still wants those, they can go back to Python 1.5.2.
* Add a call to Tcl_FindExecutable(). This was inspired by a patch byGuido van Rossum2000-03-271-0/+6
| | | | | Martin von Loewis (whose more elaborate patch to use objects is still under review).
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-28/+28
| | | | PyArg_ParseTuple() format string arguments as possible.
* Patch by Dieter Maurer to make things work for Tcl/Tk 8.1 (tested withGuido van Rossum1999-11-051-0/+4
| | | | | | 8.1.1). His approach doesn't work with Tcl/Tk 8.2, so I've placed it inside #if TKMAJORMINOR == 8001 and #endif. See also his patch for tkappinit.c.
* Include myselect.h -- needed on some platforms.Guido van Rossum1999-01-251-0/+1
|
* Thanks to Chris Herborth, the thread primitives now have proper Py*Guido van Rossum1998-12-211-11/+11
| | | | | names in the source code (they already had those for the linker, through some smart macros; but the source still had the old, un-Py names).
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* RajGopal Srinivasan noted that the latest code doesn't work whenGuido van Rossum1998-11-171-0/+6
| | | | | running in a non-threaded environment. He added some #ifdefs that fix this.
* Looks like I didn't test this interactively. The EventHook() code wasGuido van Rossum1998-10-121-4/+1
| | | | | broken; it asked for the current thread state when there was none. Fixed by using the saved event_tstate.
* Patch by Jonathan Giddy (with some cleanup by me) to always use theGuido van Rossum1998-10-091-22/+30
| | | | | | thread state of the thread calling mainloop() (or another event handling function) rather than the thread state of the function that created the client data structure.
* There's no need to declare Tk_GetNumMainWindows() (and it breaksGuido van Rossum1998-10-081-2/+0
| | | | something in the latest win342 build).
* Renamed thread.h to pythread.h.Guido van Rossum1998-10-011-1/+5
|
* Get rid of the test for non-NULL thread state in EventHook; it can beGuido van Rossum1998-09-211-2/+0
| | | | triggered in situations that are not an error.
* Need mytime.h for Sleep().Guido van Rossum1998-08-131-0/+2
|
* Undo a silly effect of a global substitution: the macintosh panic()Guido van Rossum1998-08-051-1/+1
| | | | | function had a reference to vPySys_WriteStderr(...) -- turn it back into fprintf(stder, ...).
* Temporarily get rid of the registration of Tcl_Finalize() as aGuido van Rossum1998-07-141-0/+5
| | | | | | | | | low-level Python exit handler. This can attempt to call Python code at a point that the interpreter and thread state have already been destroyed, causing a Bus Error. Given the intended use of Py_AtExit(), I'm not convinced that it's a good idea to call it earlier during Python's finalization sequence... (Although this is the only use for it in the entire distribution.)
* Add a cast that a picky SGI compiler found was necessary.Guido van Rossum1998-07-071-1/+1
|
* There was an error check in a loop in PythonCmd which calledGuido van Rossum1998-06-191-1/+1
| | | | | | | PythonCmd_Error() but failed to return. The error wasn't very likely (only when we run out of memory) but since the check is there we might as well return the error. (I think that Barry introduced this buglet when he added error checks everywhere.)
* # Note: a previous checkin message was lost because I can now use CVSGuido van Rossum1998-06-151-36/+7
| | | | | | | | | # from my PC at home, but it can't send email :-( Add a clarifying comment about the new ENTER_OVERLAP and LEAVE_OVERLAP_TCL macros; get rid of all the bogus tests for deleted interpreters (Tcl already tests for this; they were left over from an earlier misguided attempt to fix the threading).
* # (My first checkin from Windows NT using remote CVS!)Guido van Rossum1998-06-151-52/+134
| | | | | | | | | | | | | | | | | | | | There were some serious problem with the thread-safety code. The basic problem was that often the result was gotten out of the Tcl interpreter object after releasing the Tcl lock. Of course, another thread might have changed the return value already, and this was indeed happening. (Amazing what trying it on a different thread implementation does!) The solution is to grab the Python lock without releasing the Tcl lock, so it's safe to create a string object or set the exceptions from the Tcl interpreter. Once that's done, the Tcl lock is released. Note that it's now legal to acquire the Python lock while the the Tcl lock is held; but the reverse is not true: the Python lock must be released before the Tcl lock is acquired. This in order to avoid deadlines. Fortunately, there don't seem to be any problems with this.
* Fixed the EventHook() code so that it also works on Windows, sort of.Guido van Rossum1998-06-131-6/+26
| | | | | | | | | | | | | (The "sort of" is because it uses kbhit() to detect that the user starts typing, and then no events are processed until they hit return.) Also fixed a nasty locking bug: EventHook() is called without the Tcl lock set, so it can't use the ENTER_PYTHON and LEAVE_PYTHON macros, which manipulate both the Python and the Tcl lock. I now only acquire and release the Python lock. (Haven't tested this on Unix yet...)
* On Windows, need #include <windows.h>; and it's MS_WINDOWS, not MS_WIN32.Guido van Rossum1998-05-291-2/+6
|
* Changes to make it possible to write multi-threaded programs usingGuido van Rossum1998-05-281-152/+390
| | | | | | | | | | Tkinter. This adds a separate lock -- read the comments. (This was also needed for Mark Hammond's attempts to make PythonWin Tkinter-friendly.) The changes have affected the EventHook slightly, too; and I've done some more cleanup of the code that deals with the different versions of Tcl_CreateFileHandler().
* Use a different implementation of EventHook(). The new versionGuido van Rossum1998-05-221-37/+74
| | | | | | | | | | registers an input file handler for stdin with Tcl and handles Tcl events until something is available on stdin; it then deletes the handler and returns from EventHook(). This works with or without GNU readline, and doesn't busy-wait. It still doesn't work for Mac or Windows :-(
* Replace all calls to fprintf(stderr, ...) with calls to PySys_WriteStderr(...).Guido van Rossum1998-05-121-7/+7
|
* Trivial little change: timer tokens shouldn't have a Print() function,Guido van Rossum1998-05-121-8/+7
| | | | they should have a Repr() function.
* Still somewhat experimental speedup. This appears to speed up theGuido van Rossum1998-04-291-9/+110
| | | | | | | | | | | | | | most common interface to Tcl, the call() method, by maybe 20-25%. The speedup code avoids the construction of a Tcl command string from the argument list -- the Tcl argument list is immediately parsed back by Tcl_Eval() into a list that is *guaranteed* (by Tcl_Merge()) to be exactly the same list, so instead we look up the command info and call the command function directly. If the lookup fails, we fall back to the old method (Tcl_Merge() + Tcl_Eval()) so we don't need to worry about special cases like undefined commands or the occasional command ("after") that sets the info.proc pointer to NULL -- let TclEval() deal with these.
* Add a new method of interpreter objects, interpaddr(). This returnsGuido van Rossum1998-04-291-0/+13
| | | | | | | | the address of the Tcl interpreter object, as an integer. Not very useful for the Python programmer, but this can be called by another C extension that needs to make calls into the Tcl/Tk C API and needs to get the address of the Tcl interpreter object. A simple cast of the return value to (Tcl_Interp *) will do the trick now.
* On the Mac a call to TkMacInitMenus is needed. Also, we passGuido van Rossum1998-04-281-2/+31
| | | | | appropriate events to Sioux so the console window remains functional. (Jack)
* Add #ifdefs so Tcl_Finalize isn't referenced when it's not defined.Guido van Rossum1998-04-201-0/+2
|
* Make new gcc -Wall happyGuido van Rossum1998-04-101-1/+1
|
* Delete the 'exit' command from the Tcl interpreter -- it would allowGuido van Rossum1998-02-191-0/+3
| | | | | users to exit Python without the normal precautions. (The can do this using os._exit() anyway, but at least that's documented.)
* Register Tcl_Finalize as a Python exit handler.Guido van Rossum1998-02-061-1/+4
|
* Darn. When thread support is disabled, the BEGIN/END macros don'tGuido van Rossum1997-10-101-4/+5
| | | | | | save and restore the tstate, but explicitly calling PyEval_SaveThread() does reset it! While I think about how to fix this for real, here's a fix that avoids getting a fatal error.
* Mac does support createfilehandler now (Jack)Guido van Rossum1997-10-081-1/+1
|
* Fix EventHook (the trick to make widgets appear when using GNUGuido van Rossum1997-10-071-3/+19
| | | | | readline) to create and use a new thread state object -- otherwise it would dump core!
* Add an optional hack for threads in Tkinter.Guido van Rossum1997-09-281-2/+2
| | | | | | | | | | | | | | | | This one works! However it requires using a modified version of tclNotify.c (provided), which requires access to the Tcl source to compile it. In order to enable this hack, add the following to the Setup line for _tkinter: tclNotify.c -DHAVE_PYTCL_WAITUNTILEVENT -I$(TCL)/generic where TCL points to the source tree of Tcl 8.0. Other versions of Tcl are not supported. The tclNotify.c file is copyrighted by Sun Microsystems; the licensing terms are in the file license.terms. According to this file, no further permission to distribute this is required, provided the file license.terms is included. Hence, I am checking that in, too.
* Export names for the types defined by this module: TkappType and TkttType.Guido van Rossum1997-09-131-0/+3
|