This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
guile-gtk: problem in "insert-text" signal handling.
- From: Stan Pinte <alto_stan at wanadoo dot be>
- To: guile-user <guile-user at gnu dot org>
- Cc: guile-gtk <guile-gtk at sources dot redhat dot com>
- Date: Fri, 14 Feb 2003 16:35:38 +0100
- Subject: guile-gtk: problem in "insert-text" signal handling.
- Organization: Alto Software
- Reply-to: alto_stan at wanadoo dot be
hello,
with the following program, I am getting garbage from the "new-text" variable, when introducing the second and following characters...
Is this a bug in guile-gtk-1.2-0.31, or am I only supposed to use the first charachter of the string?
thanks a lot,
Stan.
output:
inserted: ["2"]
inserted: ["3B
L:6@XB
p@@D@"]
inserted: ["4B
L:6@XB
p@@D@"]
inserted: ["7B
L:6@XB
p@@D@"]
inserted: ["8B
L:6@XB
p@@D@"]
test program:
(use-modules (ice-9 format))
(use-modules (gtk gtk))
(let ((window (gtk-window-new 'toplevel))
(button (gtk-button-new-with-label "Say Hello"))
(ref-entry (gtk-entry-new)))
(gtk-widget-set-name button "mybutton")
(gtk-widget-set-name window "mywindow")
(gtk-window-set-title window "Guile-Gtk: Hello World")
(gtk-container-border-width window 10)
; (gtk-container-add window button)
(gtk-container-add window ref-entry)
(gtk-signal-connect ref-entry "insert-text"
(lambda (new-text new-length position)
(if (string? new-text)
(format #t "inserted: [~s]~%" new-text)
(format #t "not text!!!~n"))))
(gtk-widget-show-all window)
(gtk-standalone-main window))
--
Stanislas Pinte
Computer Consultant
98, rue Bois l'Evque
B-4000 Lige
web: http://www.altosw.be
email: alto_stan@wanadoo.be