Re: [gob-list] signals with GTK_TYPE_ADJUSTMENT

From: Jiri Lebl <jirka_at_5z.com>
Date: Thu, 29 Jan 2009 07:55:00 -0600

Dov Grobgeld wrote:
> In hope that the mailing list isn't dead yet, I wonder if someone can
> help me with some gob2 syntax.
>
> I got stuck on trying to create signals with the following signature
> (copied from GtkTextView) in gob:
>
> signals[SET_SCROLL_ADJUSTMENTS] =
> g_signal_new (I_("set_scroll_adjustments"),
> G_OBJECT_CLASS_TYPE (gobject_class),
> G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
> G_STRUCT_OFFSET (MyFooClass, set_scroll_adjustments),
> NULL, NULL,
> _gtk_marshal_VOID__OBJECT_OBJECT,
> G_TYPE_NONE, 2,
> GTK_TYPE_ADJUSTMENT,
> GTK_TYPE_ADJUSTMENT);
>
> I tried the following:
>
> signal last NONE (GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT)
> gboolean
> set_scroll_adjustments (self,
> Gtk:Adjustment *hadjustment,
> Gtk:Adjustment *vadjustment)

1) you have a gboolean return and you specify NONE for your return, you
should have BOOLEAN there
2) Use OBJECT or POINTER instead of GTK_TYPE_ADJUSTMENT. These types are
used for the marshalling, and it is sufficient to pass objects as OBJECTs or
even just POINTERs. The type checking is done at a different place.

George

-- 
George <jirka_at_5z.com>
    Few people can be happy unless they hate some other person,
    nation or creed.
                        -- Bertrand Russell
Received on Thu Jan 29 2009 - 07:55:02 CST

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:05:02 CDT