From: Hidetoshi NAGAI Date: 2004-02-12T00:41:03+09:00 Subject: Re: TkEntry with { (left brace) characters Hi, From: Hidetoshi NAGAI Subject: Re: TkEntry with { (left brace) characters Date: Mon, 9 Feb 2004 04:22:49 +0900 Message-ID: <20040209.042243.74736283.nagai@ai.kyutech.ac.jp> > Sorry. It's a bug of TkVariable#to_s (TkComm::string). > Please use TkVariable#value instead of TkVariable#to_s. I committed the following patch to CVS head. It makes TkVariable#to_s to call TkVariable#value. At the same time, I think it will fix the bug to treat a Tcl/Tk's string with escaping special characters. However, I remain ambivalence about backporting to Ruby 1.8.x. Although the patch fixes some problems (e.g. A validatecommand of TkEntry cannot acquire a right string when the entry box has a string which has unbalanced braces such as "a {"), Ruby/Tk loses backward compatibility. An easily understandable example of incompatibility is a return value of TkComm::Event#char. When a key event about a left brace occurs, Ruby/Tk without the patch returns an escaped left brace "\{". But with the patch, returns only a left brace "{". Of cource, it is a bug to return "\{". Though a bug, some scripts may presume an escaped left brace. Your comments on the patch are welcome. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)