Re: gtksheet2 - addition of rows with widgets



On Mon, 2004-02-23 at 09:43, Joseph Turner wrote:

> Replaced
> 
> gtk_widget_set_parent (widget, GTK_WIDGET(sheet));
> with
> g_object_ref (widget);
> gtk_object_sink (GTK_OBJECT (widget));
> widget->parent = GTK_WIDGET(sheet);

You should use gtk_widget_set_parent(), which takes care of that, and
also maintains some invariants that the widget system expects.

> Problem was that the requirement that if the parent is realized the child
> needs to be realized meant that the routine -
> 
> gtk_sheet_realize_child(sheet, child);
> 
> futher below wasn't getting run.

Child widgets are automatically realized when they need to be; you don't
need to call gtk_widget_realize() on them explicitly.

However, if your subwidgets are not children of widget->window, you
should call gtk_widget_set_parent_window() on them.

See the widgets that come with GTK+; there are many examples of how to
do this kind of thing.

  Federico




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