Re: gtk_table_attach()



On Wed, 10 Aug 2011 15:41:35 +0100
John Emmas <johne53 tiscali co uk> wrote:

Using gtk_table_atttach() I can attach widgets to a table.  Suppose
the table is in a dialog box.  I hide the dialog but next time I
display it, I want some other widget to occupy the same space.  There
doesn't seem to be a 'gtk_table_detach()' function - so:-

1)  Is there some other way to remove a widget from the table?

GtkTable inherits from GtkContainer so you can just call

  gtk_container_remove(table, widget).

Be sure to grab a reference on the widget if you don't want it to be
destroyed after the removal from the table.

2)  If I attach a new widget in the same place as the previous one,
will this work (i.e. will it replace the previous widget) or is this
just asking for trouble?

Whether this makes sense or not depends on your application.
Technically speaking it's no problem at all to replace widgets.

  - Jannis



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