Re: Writing a new widget - gtk_type_unique has been deprecated


"Bradley F. Hartman" <hartman mcci-arl-va com> writes:

> I'm going through the tutorial on how to create a new widget.  The tutorial
> indicates that every new widget needs to have a _get_type() function
> (the tutorial function name is tictactoe_get_type()) 
> (
> In the tutorial, this function calls gtk_type_unique().  In an attempt to
> understand exactly what tictactoe_get_type() is supposed to do, I looked up
> gtk_type_unique() in the reference manual.  I found that not only is this
> function deprecated but the entire GtkTypeClass, which is "the base
> structure for all GTK+ types" has been deprecated
> (!  
> The reference manual, to the best of my knowledge, did not indicate what 
> should be used instead.
> My question is, therefore, what has taken the place of the GtkTypeClass and
> associated types & functions?  Does anyone have an example of a widget
> they created that uses the new types & functions?

Take a look at the GObject API reference:

While most GtkWidgets are still derived from GtkObject, the base of
the object and type system is not part of GTK+ anymore, but has been
factored out into its own library.

The equivalent of gtk_type_unique() should be g_type_register_static().

Salut, Sven

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