For an example of how to create GObjects (all GktWidgets are derived from
it), you can check the code in CVS for diferent objects in Gnome-DB in:

http://cvs.gnome.org/viewcvs/libgnomedb/libgnomedb/

Gnome-Db defines a lot of new Widgets to manipulate data from Data Bases,
then I think is a good example. Review the GObject documentation.

You mus have a your_widget_class_init function with this:

/* Properties */
        object_class->set_property = gnome_db_grid_set_property;
        object_class->get_property = gnome_db_grid_get_property;
    g_object_class_install_property (object_class, PROP_RAW_GRID,
                                         g_param_spec_object ("raw_grid",
NULL, NULL,
                                  GNOME_DB_TYPE_RAW_GRID,
                                  G_PARAM_READABLE));
    g_object_class_install_property (object_class, PROP_INFO,
                                         g_param_spec_object ("widget_info",
NULL, NULL,
                                  GNOME_DB_TYPE_DATA_WIDGET_INFO,
                                  G_PARAM_READABLE));


2006/8/23, Tristan Van Berkom <[EMAIL PROTECTED]>:
>
> Madhusudan E wrote:
> > Hi,
> > The property wasn't defined on the object, But it started working when I
> > defined the first_property in g_object_new().
> >
> > I have a query here,
> > Doesn't the gobject_class->set_property function be invoked without
> sending
> > the first_property parameter in g_object_new().
> > If not then somewhere it needs to documented.
> >
>
> I dont understand your question really,
>    - g_object_new() creates an object with the specified properties
>      (if any properties are specified - otherwise they are assumed to be
>      the defaults that you specified in the GParamSpec)
>    - You can later set these properties using g_object_set()
>    - If you cant set a property using g_object_set() later on - then you
>      probably didnt give it G_PARAM_WRITABLE permissions or you called it
>      G_PARAM_CONSTRUCT_ONLY.
>
> Cheers,
>                 -Tristan
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>



-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (entrámite, pero para los cuates:
LIBRE)
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to