This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: guile-gtk: problem in "insert-text" signal handling.
- From: Daniel Skarda <0rfelyus at ucw dot cz>
- To: alto_stan at wanadoo dot be
- Cc: guile-user <guile-user at gnu dot org>, guile-gtk<guile-gtk at sources dot redhat dot com>
- Date: Sun, 16 Mar 2003 09:31:56 +0100
- Subject: Re: guile-gtk: problem in "insert-text" signal handling.
- References: <20030214163538.12f31385.alto_stan@wanadoo.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?
I think you found a (design) bug in Gtk+ - string received by signal handler
is not terminated by '\000', the length of the string is passed as an additional
argument. Unfortunately, any other signal does not use "STRING, LENGTH" pattern
for passing string parameters. The bug is also potential source of SIGSEGV (when
no random '\000' is found, which is quite unlikely - but hey, all hideous bugs
have unlikely conditions.... )
Another sad part of the story: sgtk_callback_marshall does not now the signal
name, so all we can do now on guile-gtk part is an ugly hack:
if (n_args == 3 && GTK_FUNDAMENTAL_TYPE (args[0]) == GTK_TYPE_STRING) && ...)
/* let's hope we handle "new-text" signal.... */
Please report the bug to Gtk+ folks.
Have a nice day,
0.