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]

Re: 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?

  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.


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