[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk
Subject:    [gtk-list] Re: gtk_object_destroy() or gtk_widget_destroy()
From:       "Emmanuel DELOGET" <pixel () epita ! fr>
Date:       1999-07-30 18:54:53
[Download RAW message or body]

>
>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
>


-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic