Re: signals with GTK_TYPE_ADJUSTMENT

Jiri Lebl <[email protected]> Thu, 29 Jan 2009 07:55:00 -0600
Newsgroups gmane.comp.gnome.devtools.gob.general
Message-ID <[email protected]>
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 <[email protected]>
    Few people can be happy unless they hate some other person,
    nation or creed.
                        -- Bertrand Russell



--
to unsubscribe:
send mail to [email protected] with "unsubscribe gob-list" in the subject