Re: Complex properties

Russell Shaw said:
> Should the type registration be done before the gtk_new_dbtab()
> is called, or within the gtk_new_dbtab() call?
> Is there an example of registering a complex g_type like
> the syntax_type struct above?

first: wrong list.  you want gtk-app-devel-list.


you just need a boxed type that wraps up a structure which contains just the
array of syntax_type objects.  the boxed type will be registered with the type
system by the first code to try to use the type macro, which will undoubtedly
be the class initializer for the class using a property of that type.

typedef struct {
    syntax_type * syntax;
    int count;
} SyntaxCollection;
SyntaxCollection * syntax_collection_copy (SyntaxCollection * c);
void syntax_collection_free (SyntaxCollection * c);
GType syntax_collection_get_type (void);
#define TYPE_SYNTAX_COLLECTION (syntax_collection_get_type())

etc, etc.

there are innumerable examples throughout the gtk+ and gnome source code. 
most relevant to your situation would be, i think GtkTargetList, which is
basically a refcounted GList.

muppet <scott at asofyet dot org>

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