Posted to tcl by kostix at Fri Jun 08 17:55:21 GMT 2007view raw

  1. if (CharUpper((LPTSTR) menuChar) == CharUpper((LPTSTR)*Tcl_UtfAtIndex(label, underline)))

Comments

Posted by kostix at Sat Jun 09 11:21:57 GMT 2007 [text] [code]

For the record: [06/08 21:50]<kostix> in Tcl_GetUnicodeFromObj what Unicode format is implied? UTF-8? [06/08 21:52]<kbk> kostix - Tcl_GetUnicodeFromObj returns a UCS-2 string in an array of Tcl_UniChar. [06/08 21:52]<kostix> kbk: thanks [06/08 21:52]<kbk> It presumes that the Tcl_Obj holds a character string, in whatever form Tcl has decided to keep it in. [06/08 21:52]<kbk> (Generally speaking, that *is* UTF-8.) [06/08 21:55]<kostix> kbk: can you look at http://paste.tclers.tk/242 ? [06/08 21:56]<kostix> kbk: the right-hand CharUpper (which is actually CharUpperA in my build of Tcl) fails when [06/08 21:57]<kostix> menuChar is '3' and the Tcl_UtfAtIndex (presumably) returns an intex of the russian character 'С' (capital es) [06/08 21:57]<kostix> * a pointer, not an index, of course [06/08 21:57]<kostix> that's the code from tkWinMenu.c [06/08 21:58]<kbk> kostix - in a few min... [06/08 21:58]<kbk> /me wonders what we're doing in a FooA interface, and not FooW. [06/08 21:59]<kostix> so the error in wish is triggered like this: 1) have a main menu with some russian words having underline, then press alt+any key (which, as I think, triggers hunting for menu accelerators) and it fails on the first non-ASCII accelerator found [06/08 21:59]<kostix> kbk: don't know -- I've just built 8.4.15 stable using vc6 and the regular makefiles [06/08 22:00]<kostix> offending proc is TkWinHandleMenuEvent, WM_MENUCHAR branch [06/08 22:03]<kostix> so the testcase: package require Tk menu .m . config -menu .m .m add cascade -label Файл -underline 0 run, then hit Alt-numeric (or alt-whatever) on winxp