Re: nevermind 2nd part of my last question



I know a hack way to do this, but wonder why you would want to.
Anyway the table struct contains a GList holding all of the child widgets as seen below:

struct _GtkTable
{
  GtkContainer container;
  
  GList *children;
  GtkTableRowCol *rows;
  GtkTableRowCol *cols;
  guint16 nrows;
  guint16 ncols;
  guint16 column_spacing;
  guint16 row_spacing;
  guint homogeneous : 1;
};

if you have the pointer of the widget you would like to remove you could do this:

GtkWidget *table;
GtkWidget *old_label;
GtkWidget *temp;
GtkWidget *new_label;
GList *children;

new_label = gtk_label_new("new label");

children = g_list_first(GTK_TABLE(table)->children);
while (children) {
    temp = children->data;
    children = children->next;
        
    if (temp == old_label) {
       temp = new_label;
       gtk_widget_destroy (old_label);
       break;
    }
}

the code would replace the widget pointer but you may need to queue a resize and a draw to get it to appear, 
and this is an evil hack if ever there were one.

todd



On Tue, 16 Jul 2002 00:32:08 -0500
Ronald Roth <rroth uiuc edu> wrote:
Nevermind the 2nd part of the my last email, regarding gtk_table_resize.

but I would still like to know how one can remove children from a table.

thanks!
-Ron

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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