How do to use a gtk_type as a property type

View: New views
3 Messages — Rating Filter:   Alert me  

How do to use a gtk_type as a property type

by Dov Grobgeld-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After having used gob2 extensively I finally and for the first time got stuck on something that I could not find in the documentation. How do I define a property that is defined by Gtk and not by Glib? It seems like the name mangling of the property name always sticks on G_TYPE_ to the property name. Shouldn't this be modifyable e.g. by doing GTK:ADJUSTMENT to make the property GTK_TYPE_ADJUSTMENT instead of G_TYPE_ADJUSTMENT?

In particular, I'm trying to convert the following code from my gtk_image_viewer widget to gob:

  g_object_class_install_property (gobject_class,
                                   PROP_HADJUSTMENT,
                                   g_param_spec_object ("hadjustment",
                            ("Horizontal adjustment"),
                            ("The GtkAdjustment that determines the values of the horizontal position for this image_viewer."),
                                                        GTK_TYPE_ADJUSTMENT,
                                                        G_PARAM_READWRITE));


Thanks a lot for gob!

Regards,
Dov


--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

Re: How do to use a gtk_type as a property type

by Jean-Yves Lefort :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 28 Aug 2007 20:55:41 +0300
"Dov Grobgeld" <dov.grobgeld@...> wrote:

> After having used gob2 extensively I finally and for the first time got
> stuck on something that I could not find in the documentation. How do I
> define a property that is defined by Gtk and not by Glib? It seems like the
> name mangling of the property name always sticks on G_TYPE_ to the property
> name. Shouldn't this be modifyable e.g. by doing GTK:ADJUSTMENT to make the
> property GTK_TYPE_ADJUSTMENT instead of G_TYPE_ADJUSTMENT?
>
> In particular, I'm trying to convert the following code from my
> gtk_image_viewer widget to gob:
>
>   g_object_class_install_property (gobject_class,
>                                    PROP_HADJUSTMENT,
>                                    g_param_spec_object ("hadjustment",
>                             ("Horizontal adjustment"),
>                             ("The GtkAdjustment that determines the values
> of the horizontal position for this image_viewer."),
>                                                         GTK_TYPE_ADJUSTMENT,
>                                                         G_PARAM_READWRITE));
property OBJECT hadjustment (..., object_type = Gtk:Adjustment)

--
Jean-Yves Lefort <jylefort@...>


--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

attachment0 (196 bytes) Download Attachment

Re: How do to use a gtk_type as a property type

by Dov Grobgeld-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks! We need an example for this in the documentation.

Btw, I had another idea for gob. It seems like it would be quite straightforward to generate language bindings from a gob files. Perhaps some kind of plug-in system for different language backends? What do you think?

Regards,
Dov

On 8/28/07, Jean-Yves Lefort <jylefort@...> wrote:
property OBJECT hadjustment (..., object_type = Gtk:Adjustment)

--
Jean-Yves Lefort <jylefort@...>



--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject