summaryrefslogtreecommitdiff
path: root/Modules/_tkinter.c
AgeCommit message (Collapse)AuthorLines
2003-05-29Backport 1.160:Neal Norwitz-4/+11
Fix SF #745055, Memory leak in _tkinter.c/Tkapp_SplitList() Also fix a memory leak in Tkapp_Split.
2003-02-11Backport: Add more missing PyErr_NoMemory() after failled memory allocsNeal Norwitz-1/+1
2002-01-28It's merge time!Michael W. Hudson-2/+2
Backport loewis' checkin of revision 1.123: Encode Unicode arguments to split/splitlist as UTF-8. Fixes #507962. 2.2.1 bugfix candidate.
2001-12-09Mods by Tony Lownds (patch 490100, slightly massaged by me) to make TkinterJack Jansen-1/+23
work with Mac OS X Aqua-Tk, all nicely within ifdefs. The process is not for the faint of heart, though: you need to download and install the (alfa) Aqua-Tk, obtain a few needed X11 headers from somewhere else and then everything builds. To run scripts using Tkinter you must build with --enable-framework, build Python.app in Mac/OSX and run your Tkinter scripts with that. Then, about half the tests in Demo/tkinter work (or at least do something). Checking this in anyway because it shouldn't break anything, and newer versions of Aqua-Tk will streamline the process.
2001-11-28sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters-2/+2
Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
2001-08-17Patch #445762: Support --disable-unicodeMartin v. Löwis-0/+11
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
2001-08-07Got rid of (hopefully) the last 68k-mac related ifdefs.Jack Jansen-7/+0
2001-07-16File handlers don't work on the mac, so don't pretend they do. I guess this ↵Jack Jansen-1/+2
is a 2.1.1 candidate, if it isn't too late for that.
2001-05-28Cruft cleanup: Removed the unused last_is_sticky argument from the internalTim Peters-2/+2
_PyTuple_Resize().
2000-10-29Do not release unallocated Tcl objects. Closes #117278 and #117167.Martin v. Löwis-3/+8
2000-10-12Fix for Bug #116453.Guido van Rossum-6/+6
Direct use of interp->result is deprecated; changing this to Tcl_GetStringResult(interp) everywhere fixed the problem of losing the error message with TclError exceptions, on Windows.
2000-10-06[ Bug #113803 ] [2.0b1 NT4.0] printing non asci char causes idle to abortGuido van Rossum-44/+86
http://sourceforge.net/bugs/?func=detailbug&bug_id=113803&group_id=5470 Add Unicode support and error handling to AsString(). Both AsString() and Merge() now return NULL and set a proper Python exception condition when an error happens; Merge() and other callers of AsString() check for errors from AsString(). Also fixed cleanup in Merge() and Tkapp_Call() return cleanup code; the fv array was not necessarily completely initialized, causing calls to ckfree() with garbage arguments! (Also reindented some lines that were longer than 80 chars and reformatted some code that used an alien coding standard.)
2000-10-05SF "bug" 115973: patches from Norman Vine so that shared libraries andTim Peters-1/+1
Tkinter work under Cygwin. Accepted on faith & reasonableness.
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-10/+0
This should match the situation in the 1.6b1 tree.
2000-07-31merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp-7/+0
marked my*.h as obsolete
2000-07-24ANSIfy some more forward declarations.Thomas Wouters-2/+2
2000-07-21Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters-8/+6
and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
2000-07-13Use PyObject_AsFileDescriptorAndrew M. Kuchling-44/+2
2000-07-12replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton-1/+1
2000-07-10ANSI-fyingPeter Schneider-Kamp-2/+0
added excplicit node * parameter to termvalid argument in validate_two_chain_ops of parsermodule.c (as proposed by fred)
2000-07-08Removed Py_PROTO, ANSI-fied sources.Fred Drake-187/+68
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-30Trent Mick <trentm@activestate.com>:Fred Drake-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.
2000-06-19Patch from Michael Hudson to fix flatten recursive data structures:Andrew M. Kuchling-5/+8
[mwh21@atrus build]$ ./python >>> import Tkinter >>> l = [] >>> l.append(l) >>> Tkinter._flatten(l) Segmentation fault (core dumped)
2000-06-18Patch from /F:Andrew M. Kuchling-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.
2000-05-04When the UTF-8 conversion to Unicode fails, return an 8-bit stringGuido van Rossum-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.)
2000-05-04Two changes to improve (I hope) Unicode support.Guido van Rossum-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?
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-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.)
2000-04-27Marc-Andre Lemburg:Guido van Rossum-1/+3
Fixes a memory leak found by Fredrik Lundh.
2000-03-31Add back an obscure "feature" to the Obj version of Tkapp_Call(): aGuido van Rossum-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.
2000-03-31Don't use the object call interface in Tk 8.0 -- the EvalObj* APIGuido van Rossum-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.
2000-03-29The Tcl_Obj patch discussed on the patches list.Guido van Rossum-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).
2000-03-28Patch by Neil Schemenauer to remove support for Tcl/Tk versions beforeGuido van Rossum-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.
2000-03-27Add a call to Tcl_FindExecutable(). This was inspired by a patch byGuido van Rossum-0/+6
Martin von Loewis (whose more elaborate patch to use objects is still under review).
2000-02-29Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum-28/+28
PyArg_ParseTuple() format string arguments as possible.
1999-11-05Patch by Dieter Maurer to make things work for Tcl/Tk 8.1 (tested withGuido van Rossum-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.
1999-01-25Include myselect.h -- needed on some platforms.Guido van Rossum-0/+1
1998-12-21Thanks to Chris Herborth, the thread primitives now have proper Py*Guido van Rossum-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).
1998-12-04Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum-1/+1
on BeOS or Windows.
1998-11-17RajGopal Srinivasan noted that the latest code doesn't work whenGuido van Rossum-0/+6
running in a non-threaded environment. He added some #ifdefs that fix this.
1998-10-12Looks like I didn't test this interactively. The EventHook() code wasGuido van Rossum-4/+1
broken; it asked for the current thread state when there was none. Fixed by using the saved event_tstate.
1998-10-09Patch by Jonathan Giddy (with some cleanup by me) to always use theGuido van Rossum-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.
1998-10-08There's no need to declare Tk_GetNumMainWindows() (and it breaksGuido van Rossum-2/+0
something in the latest win342 build).
1998-10-01Renamed thread.h to pythread.h.Guido van Rossum-1/+5
1998-09-21Get rid of the test for non-NULL thread state in EventHook; it can beGuido van Rossum-2/+0
triggered in situations that are not an error.
1998-08-13Need mytime.h for Sleep().Guido van Rossum-0/+2
1998-08-05Undo a silly effect of a global substitution: the macintosh panic()Guido van Rossum-1/+1
function had a reference to vPySys_WriteStderr(...) -- turn it back into fprintf(stder, ...).
1998-07-14Temporarily get rid of the registration of Tcl_Finalize() as aGuido van Rossum-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.)
1998-07-07Add a cast that a picky SGI compiler found was necessary.Guido van Rossum-1/+1
1998-06-19There was an error check in a loop in PythonCmd which calledGuido van Rossum-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.)