chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Chicken/tk widgets can't handler certain characters


From: felix winkelmann
Subject: Re: [Chicken-users] Chicken/tk widgets can't handler certain characters
Date: Tue, 26 Apr 2005 12:37:08 +0200

On 4/23/05, Matt Gushee <address@hidden> wrote:
> I guess the subject line is pretty self-explanatory. I have discovered
> that, (at least on my system), when you attempt to load text containing
> certain characters into certain types of widgets, it causes errors, up
> to and including segfaults. So far, the bad characters that I know of
> are '[' and '$', and the problem affects text and listbox widgets. I
> would guess it also affects canvas text items, but I haven't tested
> them. It does not appear to affect labels.
> 

Ok, here is a patch. Boy, Tcl's quoting rules are sick!

It also appears to be the case that the amount of text that can be
sent at once is limited, so in this little example, I insert line by line:

(use tk utils)

(start-tk)

(define text (tk 'create-widget 'text))

(for-each-argv-line
 (lambda (x)
   (text 'insert 'end x)
   (text 'insert 'end "\n") ) )

(tk/pack text)

(event-loop)


The patch:

% diff -u ~/stuff/work/tk.scm ~/stuff/tk.scm
--- /home/fwinkel/stuff/work/tk.scm     2005-04-26 12:25:58.091285648 +0200
+++ /home/fwinkel/stuff/tk.scm  2005-04-26 11:24:17.601845552 +0200
@@ -410,10 +410,7 @@
                                       " \""
                                       (string-translate*
                                         x
-                                        '(("\\" . "\\\\") ("\"" . "\\\"")
-                                         ("[" . "\\u005b") ("]" . "\\]")
-                                         ("{" . "\\{") ("}" . "\\}")
-                                         ) )
+                                        '(("\\" . "\\\\") ("\"" . "\\\"")))
                                       "\"")))
                                  (else (string-append " " (->string x)))))
                          (tk-args-of args)))))


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]