From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10374 invoked by alias); 16 Mar 2003 09:06:43 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 10276 invoked from network); 16 Mar 2003 09:06:41 -0000 Received: from unknown (HELO mail.tiscali.cz) (213.235.135.71) by sources.redhat.com with SMTP; 16 Mar 2003 09:06:41 -0000 Received: from hobitin.ucw.cz (212.11.106.178) by mail.tiscali.cz (6.0.044) id 3E6FFDAA0009CC69; Sun, 16 Mar 2003 10:03:54 +0100 Received: from 0rfelyus by hobitin.ucw.cz with local (Exim 3.36 #1 (Debian)) id 18uTYi-0000Hg-00; Sun, 16 Mar 2003 09:31:56 +0100 To: alto_stan@wanadoo.be Cc: guile-user , guile-gtk Subject: Re: guile-gtk: problem in "insert-text" signal handling. From: Daniel Skarda <0rfelyus@ucw.cz> Date: Sun, 16 Mar 2003 09:06:00 -0000 In-Reply-To: <20030214163538.12f31385.alto_stan@wanadoo.be> (Stan Pinte's message of "Fri, 14 Feb 2003 16:35:38 +0100") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/20.7 References: <20030214163538.12f31385.alto_stan@wanadoo.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q1/txt/msg00014.txt.bz2 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.