signals with GTK_TYPE_ADJUSTMENT

From: Dov Grobgeld <dov.grobgeld_at_gmail.com>
Date: Sun, 25 Jan 2009 20:56:20 +0200

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)

but got the error "Error: Unknown GTK+ type 'GTK_TYPE_ADJUSTMENT' among
signal types".

This also failed:

 signal last NONE (OBJECT=Gtk:Adjustment, OBJECT=Gtk:Adjustment)
  gboolean
  set_scroll_adjustments (self,
                          Gtk:Adjustment *hadjustment,
                          Gtk:Adjustment *vadjustment)

which gave the error "Error: syntax error before '='".

In the end I used:

 signal last NONE (OBJECT, OBJECT)
  gboolean
  set_scroll_adjustments (self,
                          Gtk:Adjustment *hadjustment,
                          Gtk:Adjustment *vadjustment)

and then applied an external patch:

- G_TYPE_OBJECT,
- G_TYPE_OBJECT);
+ GTK_TYPE_ADJUSTMENT,
+ GTK_TYPE_ADJUSTMENT);

But of course I wonder whether there is any syntax to do this in gob2?

Thanks!
Dov
Received on Sun Jan 25 2009 - 12:56:24 CST

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