From: Laurent D. <lau...@ne...> - 2000-08-28 15:39:43
|
Hi, Here is another patch for the -underline stuff which addresses some of the issues that Scott has raised with my first patch. On 22 Aug, Scott Stanton wrote: > - If you are adding \_ to the Tcl backslash parser, you need to do the > same thing for the regexp backslash parser. > Not implemented yet. > - Rather than putting a constant like 0x332 directly in the code, it might > be better to add a #define for TCL_COMBINING_LOW_LINE (the official > Unicode character name). > Done. > - Don't assume that the \_ character actually takes 2 bytes. This is only > true if the string is in canonical UTF form. It's actually possible to > represent a \_ with 3 or more bytes in a non-canonical form. Always use > the Tcl UTF functions to compute character offsets. > Done. > - Your algorithm ends up scanning the string twice. It would be faster to > skip the call to Tcl_UtfFindFirst() and just do character by character > comparisons. > Kinda done. I still have to set up a display string object. I do it with Tcl_DuplicateObj but I'm pretty sure there's a better way to do it. I haven't had enough time to think things through properly. > - If you remove the \_ from the original text string, then a cget -text > won't return the correct value. You need to make a separate copy of the > string for rendering purposes. > Done. > - If you were going to update the string in place, you should call > Tcl_SetObjLength to set the new length. > Done. It should work with Win and Mac too. I figure I'd release this interim patch to get more feedback. a2 is pretty late and I somehow have the nagging feeling that the incompleteness of the I18N stuff isn't helping. I'd like to have feedback on the general ideas in the patcch, specially from people like George Petasis and Keiichi Takahashi who use fonts that are outside of ISO Latin 1. If people like the idea and if the implementation doesn't suck too bad, there are a few more things to do: - Patch the regexp stuff - Translate all the msgcat strings to use the \_ mechanism - Document the changes in the man page - Fix the key bindings in the dialogs. I was thinking of using the new functionality to do something like: set bindchar [string index [.button cget -text] [.button cget -underline]] bind <Alt-$bindchar> {.....} If anyone is willing to help out with some of this, I'd appreciate it. Otherwise, I'll do it as time permits. I'm not sure how soon we need all this. L -- MY EMAIL ADDRESS HAS CHANGED --> UPDATE YOUR ADDRESSBOOK Laurent Duperval "Montreal winters are an intelligence test, Netergy Networks - Java Center and we who are here have failed it." Phone: (514) 282-8484 ext. 228 -Doug Camilli mailto:lau...@ne... Penguin Power! |