public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* guile-gtk: problem in "insert-text" signal handling.
@ 2003-02-14 15:06 Stan Pinte
  2003-03-16  9:06 ` Daniel Skarda
  0 siblings, 1 reply; 4+ messages in thread
From: Stan Pinte @ 2003-02-14 15:06 UTC (permalink / raw)
  To: guile-user; +Cc: guile-gtk


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'Evêque
	B-4000 Liège

web:		http://www.altosw.be
email:		alto_stan@wanadoo.be

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: guile-gtk: problem in "insert-text" signal handling.
@ 2003-04-02  0:05 Daniel Skarda
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Skarda @ 2003-04-02  0:05 UTC (permalink / raw)
  To: guile-gtk


Kevin Ryde <user42@zip.com.au> writes:
> Perhaps the class of the object could be checked too.  If it's a
> GtkEditable with string+int+pointer parameters then that be tight
> enough to avoid hitting anything else.

  You are right. First I rejected the idea - I was aware of
gtk_signal_connect_object function. But fortunately there are no guile-gtk
bindings for the function, so the problem looks simple now (though check
for GtkEditale+string+... still smells like ugly hack).

0.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-02  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-14 15:06 guile-gtk: problem in "insert-text" signal handling Stan Pinte
2003-03-16  9:06 ` Daniel Skarda
2003-03-31 22:50   ` Kevin Ryde
2003-04-02  0:05 Daniel Skarda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).