Re: g_object_class_install_property
Madhusudan E wrote: [...] All I want to know is, Well the above stated behaviour of GTK is default behavior or Am I going wrong some where. If the property is never explicitly specified, either via g_object_new() or g_object_set() - then the set_property class method will _not_ be called. When you create a GParamSpec for your property, you give it a default value, why would g_object_new() need to redundantly sync that default if you already specified it ? Cheers, -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_object_class_install_property
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
Re: g_object_class_install_property
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
RE: g_object_class_install_property
Hi Daniel and Tristan, Thanks for your replies. I did succeed installing the properties, more or less same as you have defined in the example. I have one concern here, After I had installed the properties , I had used g_object_new (GTK_TYPE_WIDGET, NULL) to create the object in gtk_widget_new() function. But (as per ur example) gnome_db_grid_set_property () wasnt invoked. But when I created the object by passing the first_argument name, i.e g_object_new(GTK_TYPE_WIDGET, raw_grid, value, NULL) only then gnome_db_grid_set_property() was invoked. All I want to know is, Well the above stated behaviour of GTK is default behavior or Am I going wrong some where. Thanks, Madhusudan E, HTIPL, Bangalore-08 - 9980527224 www.huawei.com This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! _ From: Daniel Espinosa [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 11:10 PM To: Tristan Van Berkom Cc: Madhusudan E; gtk-app-devel-list@gnome.org Subject: Re: g_object_class_install_property 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
g_object_class_install_property
Hi All, I have defined a new widget and I want to install properties. I have defined Gobject_class-set_property Gobject_class-get_property to my local functions. And as well I have installed the property using G_object_class_install_property() But the control is not getting passed to the local functions that I have set to Gobject_class-set_property and Gobject_class-get_property. Is there any other dependencies that I need to ckeck??? Pls Reply. Rgds, Madhu This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_object_class_install_property
Madhusudan E wrote: Hi All, I have defined a new widget and I want to install properties. I have defined Gobject_class-set_property Gobject_class-get_property to my local functions. And as well I have installed the property using G_object_class_install_property() But the control is not getting passed to the local functions that I have set to Gobject_class-set_property and Gobject_class-get_property. Is there any other dependencies that I need to ckeck??? Does that property already exist on that object ? -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: g_object_class_install_property
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. Pls give ur concerns. This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: Tristan Van Berkom [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 22, 2006 7:07 PM To: Madhusudan E Cc: gtk-app-devel-list@gnome.org Subject: Re: g_object_class_install_property Madhusudan E wrote: Hi All, I have defined a new widget and I want to install properties. I have defined Gobject_class-set_property Gobject_class-get_property to my local functions. And as well I have installed the property using G_object_class_install_property() But the control is not getting passed to the local functions that I have set to Gobject_class-set_property and Gobject_class-get_property. Is there any other dependencies that I need to ckeck??? Does that property already exist on that object ? -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list