Re: [gtk-list] Widget inheritance question



During the implementation of your widget's new function, you create an
instance of your parent widget and pass it any parameters it would need.
That is where you essentially call the constructor for the parent class.
You can follow the implementation of the GtkToggleButton class in
gtktogglebutton.c for examples on inheritance.  That's what I did, and it
was massively helpful.  :)

--Jason

On Thu, 23 Jul 1998, Square Avenue wrote:

> 
> I'm currently following the GTK tutorial on how to inherit widgets to
> create new composite widgets and I have a question about the inheritance
> itself.
> 
> In C++, you can simply pass on arguments to the parent class (or widget)
> in the constructor.  However, in vanilla GTK, I don't see any way to pass
> the arguments I need to the parent widget (in this case GtkWindow).
> 
> How do I get my new widget to set the type of its parent widget
> (GtkWindow) to GTK_WINDOW_TOPLEVEL by default?  Pointers to examples or
> tips on how to do this would be greatly appreciated.  Thanks!
> 
>                                       - Dave
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>   Name:  David Finton                  | "Don't be afraid you'll make really
>  Email:  dfinton@d.umn.edu             |  dumb mistakes.  Sometimes really
>    Web:  http://www.d.umn.edu/~dfinton |  dumb mistakes are the only way to
>                                        |  learn the really fundamental and
>                                        |  important lessons in life."
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 

-------------------------------------------------------------------------------
Jason A. Pfeil, Computer Science Graduate Student      101 Carothers Hall
http://www.cs.fsu.edu/~pfeil			       C3527 University Center
pfeil@cs.fsu.edu				       (850)644-8014



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