This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

guile-gtk: problem in "insert-text" signal handling.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]