Bug#221596: marked as done (gtk_text_view_get_iter_location() always returns incorrect y value)

Debian Bug Tracking System owner@bugs.debian.org
Mon, 18 Oct 2004 07:33:08 -0700


Your message dated Mon, 18 Oct 2004 16:20:57 +0200
with message-id <20041018142057.GA3868@via.ecp.fr>
and subject line textview.get_iter_location() always returns incorrect rect.y
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 19 Nov 2003 08:44:45 +0000
>From xanni@kira.glasswings.com.au Wed Nov 19 02:44:44 2003
Return-path: <xanni@kira.glasswings.com.au>
Received: from mail003.syd.optusnet.com.au [211.29.132.144] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1AMNx6-0006ty-00; Wed, 19 Nov 2003 02:44:44 -0600
Received: from kira.glasswings.com.au (c211-28-119-243.eburwd3.vic.optusnet.com.au [211.28.119.243])
	by mail003.syd.optusnet.com.au (8.11.6p2/8.11.6) with ESMTP id hAJ8igr19438
	for <submit@bugs.debian.org>; Wed, 19 Nov 2003 19:44:42 +1100
Received: (from xanni@localhost)
	by kira.glasswings.com.au (8.9.3/8.9.3) id TAA04137
	for submit@bugs.debian.org; Wed, 19 Nov 2003 19:54:25 +1100
Date: Wed, 19 Nov 2003 19:54:24 +1100
From: Andrew Pam <xanni@glasswings.com.au>
To: submit@bugs.debian.org
Subject: gtk_text_view_get_iter_location() always returns incorrect y value
Message-ID: <20031119085423.GF25247@kira.glasswings.com.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4i
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0
	tests=HAS_PACKAGE
	version=2.53-bugs.debian.org_2003_11_15
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_11_15 (1.174.2.15-2003-03-30-exp)

Package: libgtk2.0-0
Version: 2.2.4-2

Please note:  This bug supercedes bug #220547
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=220547

gtk_text_view_get_iter_location() always returns rect.y == rect.height
rather than the correct value, as demonstrated by this test program:

----- cut here -----

// Test GTK2 get_iter_location()
// written 2003/11/13 by Andrew Pam <andrew@sericyb.com.au>
// ported from python to C++ 2003/11/19 by Andrew Pam <andrew@sericyb.com.au>
// demonstrates that textview.get_iter_location() always
// returns rect.y == rect.height rather than the correct value

#include <gtk/gtk.h>

// Define global variables
GdkRectangle rect;
gchar *text = "\
* The total area of the M-DB is about 1,000,000 square Km\n\
or approximately one-seventh (14%) of Australia\n\
\n\
* The M-DB is 1450Km long and 1000Km wide\n\
\n\
* The M-DB consists largely of plains, but rises to the\n\
Great Dividing Range on its eastern and southern rim\n\
\n\
* One of the world's major river systems\n\
";

static void quit( GtkWidget *widget, gpointer data )
{
	char string[80];

	snprintf(string, 80, "x = %d, y = %d\n", rect.x, rect.y);
	g_print (string);
	snprintf(string, 80, "w = %d, h = %d\n", rect.width, rect.height);
	g_print (string);
	gtk_main_quit ();
}

int main( int argc, char *argv[] )
{
	GtkWidget *window;
	GtkTextBuffer *textbuffer;
	GtkWidget *textview;
	GtkWidget *box;
	GtkWidget *button;
	GtkTextIter iter;

        gtk_init (&argc, &argv);
	        
	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (window), "destroy",
			  G_CALLBACK (quit), NULL);
	textbuffer = gtk_text_buffer_new ( NULL );
	textview = gtk_text_view_new_with_buffer ( textbuffer );
	box = gtk_vbox_new ( FALSE, 0 );
	gtk_container_add (GTK_CONTAINER (box), textview );
	button = gtk_button_new_with_label ("Quit");
	g_signal_connect (G_OBJECT (button), "clicked",
		          G_CALLBACK (quit), NULL);
	gtk_container_add (GTK_CONTAINER (box), button);
	gtk_container_add (GTK_CONTAINER (window), box);
	gtk_widget_show_all (window);
	gtk_text_buffer_set_text ( textbuffer, text, strlen(text) );
	gtk_text_buffer_get_end_iter( textbuffer, &iter );
	// Move the cursor to the letter "s" in the last word "systems"
	gtk_text_iter_backward_word_start ( &iter );
	gtk_text_view_get_iter_location (GTK_TEXT_VIEW (textview),
					 &iter, &rect );
		        
	gtk_main ();
	return 0;
}

----- cut here -----

I am using Debian GNU/Linux Sarge, kernel 2.4.22 and libc6 2.3.2.ds1-10.
libgtk2.0-0 is version 2.2.4-2.

Regards,
	Andrew Pam
-- 
mailto:xanni@xanadu.net                         Andrew Pam
http://www.xanadu.com.au/                       Chief Scientist, Xanadu
http://www.glasswings.com.au/                   Technology Manager, Glass Wings
http://www.sericyb.com.au/                      Manager, Serious Cybernetics

---------------------------------------
Received: (at 220547-done) by bugs.debian.org; 18 Oct 2004 14:21:01 +0000
>From lool@bee.dooz.org Mon Oct 18 07:21:01 2004
Return-path: <lool@bee.dooz.org>
Received: from postfix3-1.free.fr [213.228.0.44] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CJYNh-0000T5-00; Mon, 18 Oct 2004 07:21:01 -0700
Received: from bee.dooz.org (levallois.dooz.org [81.57.180.178])
	by postfix3-1.free.fr (Postfix) with ESMTP id DAE7B173535;
	Mon, 18 Oct 2004 16:20:59 +0200 (CEST)
Received: by bee.dooz.org (Postfix, from userid 1000)
	id 5C5636AC74D1; Mon, 18 Oct 2004 16:20:57 +0200 (CEST)
Date: Mon, 18 Oct 2004 16:20:57 +0200
From: =?iso-8859-1?Q?Lo=EFc?= Minier <lool@dooz.org>
To: Andrew Pam <xanni@glasswings.com.au>,
	220547-done@bugs.debian.org, 221596-done@bugs.debian.org
Subject: Re: textview.get_iter_location() always returns incorrect rect.y
Message-ID: <20041018142057.GA3868@via.ecp.fr>
References: <20031113075346.GA23989@kira.glasswings.com.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <20031113075346.GA23989@kira.glasswings.com.au>
Content-Transfer-Encoding: quoted-printable
Delivered-To: 220547-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

     Hi,

Andrew Pam <xanni@glasswings.com.au> - Thu, Nov 13, 2003:

> textview.get_iter_location() always returns rect.y =3D=3D rect.height r=
ather
> than the correct value, as demonstrated by this test program:

 Upstream considered this is not a bug, here's the response:
 ------- Additional Comment #2 From Matthias Clasen  2003-12-27 17:35
 -------

 This is probably the result of working on an unrealized text view,
 though I can't explain exactly where the y =3D=3D 17 originates. Moving
 the get_iter_location() call into the callback makes your testcase=20
 report=20

 x =3D 202, y =3D 136
 w =3D 7, h =3D 17


 I'm closing the two Debian bugs.  Feel free to resubmit or better
 reopen if you consider this is insufficient.

   Regards,

--=20
Lo=EFc Minier <lool@dooz.org>