Re: Bug in GtkCTree (gtk+ 1.2.10) or am I just misunderstanding the API?



Thanks!

But my program uses no pixmaps and gtk_ctree_node_get_text() still returns bad
data for column 0, not columns 1-n.  However, gtk_ctree_node_get_pixtext()
works.  I'm suspicious that gtk_ctree_node_get_text() was never debugged
because everybody uses pixmaps in column 0.

I'll see if I can produce a test case using no pixmaps.  That would require a
little bit more work with testgtk.c, but it would be a royal pain with my
program.

By the way, is the GtkCTree widget documented anywhere?  The tutorial is "under
construction" and both New Riders' books I have don't have any example code.

John

In message <20011204155513 J21992 ispi net>, Andrei Zmievski writes:

>If you insert a node with both text and pixmap, you have to use
>gtk_ctree_node_get_pixtext() to retrieve the contents.
>
>On Tue, 04 Dec 2001, jgotts linuxsavvy com wrote:
>> I cannot get the GtkCTree widget to work with my application.  I've modified
>> the testgtk.c program from the source distribution to show the problem.  Her
>e
>> is the diff.  See below for the bad output.
>> 
>> --- testgtk.c.orig	Tue Dec  4 16:28:13 2001
>> +++ testgtk.c	Tue Dec  4 16:36:13 2001
>> @@ -4546,6 +4546,8 @@
>>    gchar buf2[60];
>>    GtkCTreeNode *sibling;
>>    gint i;
>> +  gchar *buf;
>> +  gint rc;
>>  
>>    text[0] = buf1;
>>    text[1] = buf2;
>> @@ -4559,6 +4561,16 @@
>>        sibling = gtk_ctree_insert_node (ctree, parent, sibling, text, 5,
>>  				       pixmap3, mask3, NULL, NULL,
>>  				       TRUE, FALSE);
>> +      rc = gtk_ctree_node_get_text(ctree, sibling, 0, &buf);
>> +      if (! rc)
>> +	      printf("GTK Bug?  The first column contained no data.\n");
>> +      else
>> +	      printf("First column is %s\n", buf);
>> +      rc = gtk_ctree_node_get_text(ctree, sibling, 1, &buf);
>> +      if (! rc)
>> +	      printf("GTK Bug?  The second column contained no data.\n");
>> +      else
>> +	      printf("Second column is %s\n", buf);
>>  
>>        if (parent && ctree->line_style == GTK_CTREE_LINES_TABBED)
>>  	gtk_ctree_node_set_row_style (ctree, sibling,
>> 
>> % ./testgtk
>> GTK Bug?  The first column contained no data.
>> Second column is Item 1-8
>> GTK Bug?  The first column contained no data.
>> Second column is Item 1-7
>> GTK Bug?  The first column contained no data.
>> Second column is Item 1-6
>> GTK Bug?  The first column contained no data.
>> Second column is Item 1-5
>> GTK Bug?  The first column contained no data.
>> Second column is Item 1-4
>> GTK Bug?  The first column contained no data.
>> Second column is Item 2-8
>> ...
>> 
>> Please help!

-- 
John GOTTS <jgotts linuxsavvy com>  http://linuxsavvy.com/staff/jgotts



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]