Re: signals with GTK_TYPE_ADJUSTMENT

Dov Grobgeld <[email protected]> Mon, 2 Apr 2018 22:10:12 +0300
Newsgroups gmane.comp.gnome.devtools.gob.general
Message-ID <CA++fsGEjp-kORDKbeCS0-fPTowLDMc-7tWqaJ7qeJAU_wFj1ww@mail.gmail.com>
This is a multi-part message in MIME format.

[email protected]
Content-Type: multipart/alternative; boundary="000000000000e0ddc10568e25640"

--000000000000e0ddc10568e25640
Content-Type: text/plain; charset="UTF-8"

It's been nine years since I looked at this last time and I wonder whether
the mailing list and Jiri's email are still alive.

I just found the issue again, while pondering why I was postprocessing the
output of gob2. None of the suggestions above work. Trying to use either
POINTER or OBJECT in the type signature of the signal causes the following
run time error:

(testgtkimageviewer:3595): Gtk-WARNING **: gtkwidget.c:5098: signal
"GtkImageViewer::set-scroll-adjustments" has wrong signature

Only after applying the patch

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

to the type signature, does the error go away, and my widget works.

So I repeat my question, is there any way to make gob2 output the patched
signal signature?

Thanks again for gob2. I still find it comfortable for using the gob2 with
the C-api and then implement the application logics in C++.

Regards,
Dov

On Thu, Jan 29, 2009 at 3:55 PM, Jiri Lebl <[email protected]> wrote:

> 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
>

--000000000000e0ddc10568e25640
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif">It&#39;s been nine years since I looked at this last ti=
me and I wonder whether the mailing list and Jiri&#39;s email are still ali=
ve.<br><br>I just found the issue again, while pondering why I was postproc=
essing the output of gob2. None of the suggestions above work. Trying to us=
e either POINTER or OBJECT in the type signature of the signal causes the f=
ollowing run time error:<br><span style=3D"font-family:monospace,monospace"=
><br>(testgtkimageviewer:3595): Gtk-WARNING **: gtkwidget.c:5098: signal &q=
uot;GtkImageViewer::set-scroll-adjustments&quot; has wrong signature</span>=
<br><br></div><div class=3D"gmail_default" style=3D"font-family:arial,helve=
tica,sans-serif">Only after applying the patch<br><br>-=C2=A0=C2=A0=C2=A0 =
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 G_TYPE_OBJECT,<br>-=C2=A0=C2=A0=C2=A0=
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 G_TYPE_OBJECT);<br>+=C2=A0=C2=A0=C2=
=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 GTK_TYPE_ADJUSTMENT,<br>+=C2=A0=
=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 GTK_TYPE_ADJUSTMENT);<br=
><br></div><div class=3D"gmail_default" style=3D"font-family:arial,helvetic=
a,sans-serif">to the type signature, does the error go away, and my widget =
works.<br><br></div><div class=3D"gmail_default" style=3D"font-family:arial=
,helvetica,sans-serif">So I repeat my question, is there any way to make go=
b2 output the patched signal signature?<br><br></div><div class=3D"gmail_de=
fault" style=3D"font-family:arial,helvetica,sans-serif">Thanks again for go=
b2. I still find it comfortable for using the gob2 with the C-api and then =
implement the application logics in C++.<br><br></div><div class=3D"gmail_d=
efault" style=3D"font-family:arial,helvetica,sans-serif">Regards,<br></div>=
<div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-seri=
f">Dov<br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_qu=
ote">On Thu, Jan 29, 2009 at 3:55 PM, Jiri Lebl <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> wr=
ote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><span class=3D"">Dov Grobgeld wrote:=
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
In hope that the mailing list isn&#39;t dead yet, I wonder if someone can h=
elp me with some gob2 syntax.<br>
<br>
I got stuck on trying to create signals with the following signature (copie=
d from GtkTextView) in gob:<br>
<br>
=C2=A0 signals[SET_SCROLL_ADJUSTMENTS<wbr>] =3D<br>
=C2=A0 =C2=A0 g_signal_new (I_(&quot;set_scroll_adjustments&quot;),<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 G_OBJECT_CLASS_TYPE (gobject_class),<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 G_STRUCT_OFFSET (MyFooClass, set_scroll_=
adjustments),<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL, NULL,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _gtk_marshal_VOID__OBJECT_OBJE<wbr>CT,<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 G_TYPE_NONE, 2,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GTK_TYPE_ADJUSTMENT,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GTK_TYPE_ADJUSTMENT);<br>
<br>
I tried the following:<br>
<br>
=C2=A0signal last NONE (GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT)<br>
=C2=A0 gboolean<br>
=C2=A0 set_scroll_adjustments (self,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 Gtk:Adjustment=C2=A0 =C2=A0 *hadjustment,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 Gtk:Adjustment=C2=A0 =C2=A0 *vadjustment)<br>
</blockquote>
<br></span>
1) you have a gboolean return and you specify NONE for your return, you sho=
uld have BOOLEAN there<br>
2) Use OBJECT or POINTER instead of GTK_TYPE_ADJUSTMENT.=C2=A0 These types =
are used for the marshalling, and it is sufficient to pass objects as OBJEC=
Ts or even just POINTERs.=C2=A0 The type checking is done at a different pl=
ace.<br>
<br>
George<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
-- <br>
George &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</=
a>&gt;<br>
=C2=A0 =C2=A0Few people can be happy unless they hate some other person,<br=
>
=C2=A0 =C2=A0nation or creed.<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0-- Bertrand Russell<br>
</font></span></blockquote></div><br></div>

--000000000000e0ddc10568e25640--


[email protected]
Content-Type: text/plain; charset=us-ascii; name="footer.txt"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

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

[email protected]