Re: gtk_object_destroy() or gtk_widget_destroy()




Per Erik Stendahl <berrs@update.uu.se> writes:

> Hi.
> 
> For a widget: do I have to call gtk_widget_destroy() or can I
> use gtk_object_destroy() instead?

======
void
gtk_widget_destroy (GtkWidget *widget)
{
  g_return_if_fail (widget != NULL);
  g_return_if_fail (GTK_IS_WIDGET (widget));
  g_return_if_fail (GTK_OBJECT_CONSTRUCTED (widget));

  gtk_object_destroy ((GtkObject*) widget);
}
======

gtk_widget_destroy() used to be required but that was
clearly not desirable, so we fixed it. (By adding the 
shutdown method.)

The only advantage of gtk_widget_destroy() is you save
typing the cast.

Regards,
                                        Owen



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