Re: signals with GTK_TYPE_ADJUSTMENT

Dov Grobgeld <[email protected]> Sun, 8 Apr 2018 13:32:40 +0300
Newsgroups gmane.comp.gnome.devtools.gob.general
Message-ID <CA++fsGET_JLQYrjVdJG3mYci9oBre1u3J-m_K3A2nz5qLcNZDg@mail.gmail.com>
This is a multi-part message in MIME format.

[email protected]
Content-Type: multipart/alternative; boundary="000000000000203fee056953cf9a"

--000000000000203fee056953cf9a
Content-Type: text/plain; charset="UTF-8"

Is this list still alive??

On Mon, Apr 2, 2018 at 10:10 PM, Dov Grobgeld <[email protected]>
wrote:

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

--000000000000203fee056953cf9a
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">Is this list still alive??<br></div></div><div class=3D=
"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Apr 2, 2018 at 10:10 P=
M, Dov Grobgeld <span dir=3D"ltr">&lt;<a href=3D"mailto:dov.grobgeld@gmail.=
com" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" st=
yle=3D"font-family:arial,helvetica,sans-serif">It&#39;s been nine years sin=
ce I looked at this last time and I wonder whether the mailing list and Jir=
i&#39;s email are still alive.<br><br>I just found the issue again, while p=
ondering why I was postprocessing the output of gob2. None of the suggestio=
ns above work. Trying to use either POINTER or OBJECT in the type signature=
 of the signal causes the following run time error:<br><span style=3D"font-=
family:monospace,monospace"><br>(testgtkimageviewer:3595): Gtk-WARNING **: =
gtkwidget.c:5098: signal &quot;GtkImageViewer::set-scroll-<wbr>adjustments&=
quot; has wrong signature</span><br><br></div><div class=3D"gmail_default" =
style=3D"font-family:arial,helvetica,sans-serif">Only after applying the pa=
tch<span class=3D""><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></span></div><div cl=
ass=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif">to t=
he type signature, does the error go away, and my widget works.<br><br></di=
v><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-se=
rif">So I repeat my question, is there any way to make gob2 output the patc=
hed signal signature?<br><br></div><div class=3D"gmail_default" style=3D"fo=
nt-family:arial,helvetica,sans-serif">Thanks again for gob2. I still find i=
t comfortable for using the gob2 with the C-api and then implement the appl=
ication logics in C++.<br><br></div><div class=3D"gmail_default" style=3D"f=
ont-family:arial,helvetica,sans-serif">Regards,<br></div><div class=3D"gmai=
l_default" style=3D"font-family:arial,helvetica,sans-serif">Dov<br></div></=
div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><br>=
<div class=3D"gmail_quote">On Thu, Jan 29, 2009 at 3:55 PM, Jiri Lebl <span=
 dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jirka@5z=
.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Dov Grob=
geld 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"m_-7724538602909958670HOEnZb"><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>
</div></div></blockquote></div><br></div>

--000000000000203fee056953cf9a--


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