Re: [gtk-list] 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.

    And it test if the gtk object is widget too.
    Another advantage is code readability - destroy
    a widget with widget_destroy() is perhaps cleaner...

    Yours,

    Emmanuel

>
>Regards,
>                                        Owen
>
>--
>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]