From: SourceForge.net <no...@so...> - 2007-10-02 21:48:03
|
Bugs item #1777362, was opened at 2007-08-19 19:31 Message generated for change (Comment added) made by boakley You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1777362&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 18. [text] Group: obsolete: 8.5a6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Talvo (talvo) Assigned to: Jeffrey Hobbs (hobbs) Summary: Double-click bug in text widget with hyphen in name Initial Comment: Using Tclkit 8.5a6, double-clicking a word in a text widget sometimes raises an error. pack [text .text-widget] .text-widget insert end "This is a test" <double click in the widget> bad text index "tk::anchor.text-widget + 1c" bad text index "tk::anchor.text-widget + 1c" while executing "$w compare $cur > $last" (procedure "tk::TextSelectTo" line 35) invoked from within "tk::TextSelectTo .text-widget 46 9" (command bound to event) This doesn't seem to happen in ActiveTcl 8.4.9. The mark is valid, as .text-widget index tk::anchor.text-widget returns correctly, but using any modifiers throws an error. From my minimal testing, this seems to only happen if the widget name contains a hyphen character; if you repeat with a text widget called .text_widget it works fine. ---------------------------------------------------------------------- Comment By: Bryan Oakley (boakley) Date: 2007-10-02 16:48 Message: Logged In: YES user_id=249075 Originator: NO I just submitted a dupe of this bug, before I realized it had already been reported. Oops! I'll put my $0.02 in here. I don't think the problem is in the index parser. The parser is handling marks with a hypen in them the same as before, near as I can tell. However, in the past the default bindings didn't use problematic marks and now they do. The default bindings are choosing to create text marks that may be incorrectly parsed under certain contexts. I think the advice to "don't do that" is bad (even though I suspect you were half joking...). In the past, Tk has been remarkably robust in the face of widgets with all sorts of odd characters. I'd hate for 8.5 to introduce restrictions on what characters we can use to name widgets. Not that I advocate weird widget names per se, but when writing library procedures it's very tempting (and common, at least for me) to just increment an index and tack it on to a common name (.frame-1, .frame-2, etc). ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2007-08-20 03:03 Message: Logged In: YES user_id=79902 Originator: NO Suggested workaround: don't use a hyphen in a widget name. (This does remind me a little of the old joke about the man who goes to his doctor complaining that it hurts every time he sticks his finger in his eye and gets told to "stop poking yourself in the eye"...) Maybe the index parser isn't quite as robust as it was? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1777362&group_id=12997 |