msg30329 - (view) |
Author: Russell Owen (reowen) |
Date: 2006-10-20 19:26 |
If Text search is called from a variable trace then the count variable is not be updated. I see this with Python 2.4.3 and Aqua Tcl/Tk 8.4.11 on MacOS X 10.4.7. I have not tested it elsewhere. Note that this works fine in tcl/tk so this appears to be a Tkinter issue. To see the problem run the attached python script. (The script also includes the equivalent tcl/tk code in its comments, so you can easily test the issue directly in tcl/tk if desired.) |
|
|
msg30330 - (view) |
Author: Matthias Kievernagel (mkiever) * |
Date: 2007-01-19 20:50 |
Same behaviour on Linux and current Python trunk. In addition I get an IndexError, if I delete the last character of the search string. Does Tk allow calling search with an empty pattern? Tkinter could handle this (with a correct result) with the following change in Tkinter.py / Text.search(): if pattern[0] == '-': args.append('--') -> if pattern and pattern[0] == '-': args.append('--') Greetings, Matthias Kievernagel |
|
|
msg76861 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2008-12-04 01:22 |
This is indeed a problem with Tkinter only, but I didn't check what is causing it yet. For the suggestion about fixing the search method regarding the pattern: the fix is almost fine, but we need to disallow None as a pattern. |
|
|
msg76881 - (view) |
Author: Matthias Kievernagel (mkiever) * |
Date: 2008-12-04 13:05 |
Nice to see someone working on this. One thing I've checked (iirc): You can set iVar in doSearch by hand like this: iVar.set(2) print 'iVar.get()', iVar.get() And iVar rests at this value. t.search does not change the value. I don't know anything about how the tcl-interpreter is embedded into python. I somehow had the impression there might be a _tkinter limitation there. Something like handling two callbacks into _tkinter at the same time or the tcl interpreter being unresponsive while calling a _tkinter function. At that point I gave up. Seen nothing obvious in _tkinter/Tkinter. Matthias Kievernagel (mkiever/at/web/dot/de) |
|
|
msg78895 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2009-01-02 22:35 |
Fixed the issue now. _tkinter.call needs to use the TCL_EVAL_GLOBAL flag since all the variables in Tkinter are global variables. Matthias: your issue about the pattern should be placed in a different issue. |
|
|
msg79460 - (view) |
Author: Matthias Kievernagel (mkiever) * |
Date: 2009-01-09 10:27 |
>Matthias: your issue about the pattern should be placed in a >different >issue. Done as Issue4890. Appended a simplified copy of the demo program and a patch there. I do not understand your remark about None though (see new issue). Cheers, Matthias Kievernagel mkiever/at/web/dot/de |
|
|
msg80944 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-02-02 15:47 |
The patch looks fine, please apply. We should come up with a deprecation strategy for GlobalCall, though, since that function is now mostly redundant. |
|
|
msg80980 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2009-02-02 18:40 |
Uhm, is it fine to remove it for good in 3.1 ? And then add a warning in 2.7 when it gets called which in turns just call Tkapp_Call ? |
|
|
msg80999 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2009-02-02 21:26 |
Commited in r69217 (r69219), r69220, r69222, r69223 Martin, I will open another ticket about GlobalCall deprecation, later today. |
|
|