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, [EMAIL PROTECTED] 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.  Here
> 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
> 
> -- 
> John GOTTS <[EMAIL PROTECTED]>  http://linuxsavvy.com/staff/jgotts
> _______________________________________________
> gtk-list mailing list
> [EMAIL PROTECTED]
> http://mail.gnome.org/mailman/listinfo/gtk-list



-Andrei

The Heineken Uncertainty Principle:
  You can never be sure how many beers you had last night.
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to