RE: [gtk-list] Assertion error with clist/scrolled_window/tables





> -----Original Message-----
> From: rhfreeman [mailto:rhfreeman@micron.com]
> Sent: Thursday, September 02, 1999 3:43 PM
> To: 'gtk-list@redhat.com'
> Subject: [gtk-list] Assertion error with clist/scrolled_window/tables
> 
> 
> Hi all,
> 
> This is my first post, so be nice :)
> 
> I've been trying to use a scrolled_window to add a scroll bar 
> to my clist.
> It does actually work, BUT I get an assertion error in 
> gtk_table_attach -
> which is this....
> 
> "Gtk-CRITICAL **: file gtktable.c: line 507 
> (gtk_table_attach): assertion
> `child->parent == NULL' failed."
> 
> The code which makes this happen is this.....
> 
>   scrolled=gtk_scrolled_window_new(NULL, NULL);
>   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
>       GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
>   gtk_table_attach_defaults (GTK_TABLE(table), scrolled, 0, 1, 0, 5);
>   gtk_widget_show(scrolled);
> 
>   clist = gtk_clist_new_with_titles(1, title);
>   gtk_clist_set_column_max_width (GTK_CLIST(clist), 0, 150);
>   gtk_table_attach_defaults (GTK_TABLE(table), clist, 0, 1, 0, 5);
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There! You shouldn't attach the CList to the table (you have already attached the
scrolled window there!) you should add it to the scrolled window like this:

	gtk_container_add (GTK_CONTAINER (scrolled), clist);

Now you won't have any error!

regards,

Arjan

>   gtk_widget_show(clist);
> 
> Is there some other way to attach it so this error does not 
> happen? Like I
> said, it does actually work fine!
> 
> Also - how would I go about changing font size/colour in the clist?
> 
> Thanks in advance for your help,
> 
> Richard
> 
> -- 
> To unsubscribe: mail -s unsubscribe 
> gtk-list-request@redhat.com < /dev/null
> 



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