FW: about destruct class object?



hi John:
now i am thinking gtk advanced technique.
if gtk is encapsulated with C++,i could rewrite some virtual function of a class.
in gtk lib,i know the widget class is equal to the v-table in C++.
now my problem is like following:
when i useing gtk_button_new(),i could create a rectangle 3D button.
however i want  to create a ellipse 3D button,how to do that?
for that purpose, i watch the source code of gtk lib,i find the draw button function
is gtk_button_draw();and gtk_button_draw------>gtk_button_paint------->gtk_paint_box
i want to rewrite the gtk_paint_box to create a ellipse 3D button, how to do that? or having 
another way to create a ellipse 3D button.

thanks you very much!
my OICQ:95898816
kason



-----Original Message-----
From: John Cupitt ng-london org uk [mailto:John Cupitt ng-london org uk]
Sent: Tuesday, April 02, 2002 7:37 PM
To: ¶À¼y Kason Huang
Cc: gtk-list gnome org
Subject: Re: about destruct class object?


¶À¼y Kason Huang wrote:
> hi:
> after i create a gtkbutton(useing gtk_button_new()),when i want to
destruct the gtkbutton,
> whether i need call gtk_widget_destroy(button) in my destruct function of
CGtkButton class encapsulated by myself.

Hi Kason, if you subclass a button, you don't need to destroy the button
yourself, just call the superclass destroy function. At the end of your
_destroy(), have something like:

  if (GTK_OBJECT_CLASS (parent_class)->destroy)
    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);

John



========================================================== 
Aelbert Cuyp 13 February - 12 May 2002 

For information and tickets: 
http://www.nationalgallery.org.uk/exhibitions/cuyp/



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