[Gtk-sharp-list] Signal handlers and the out keyword:

Mark Crichton crichton@gimp.org
Wed, 4 Jun 2003 13:55:07 -0400


--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Ok, so I have a signal handler defined with the following XML api:

<signal name="NewWindow" cname="new_window" when="FIRST">
   <return-type type="void"/>
   <parameters>
       <parameter type="GtkMozEmbed*" name="embed"/>
       <parameter type="GtkMozEmbed**" name="newEmbed" pass_as="out"/>
       <parameter type="guint" name="chromemask"/>
   </parameters>
</signal>

Now, the generator produces the following in NewWindowHandler.cs:

namespace GtkMozEmbedSharp {

        using System;

        public delegate void NewWindowHandler(object o, NewWindowArgs args);

        public class NewWindowArgs : GtkSharp.SignalArgs {
                public GtkMozEmbed.EmbedWidget NewEmbed{
                        get {
                                return (GtkMozEmbed.EmbedWidget) Args[0];
                        }
                }

                public uint Chromemask{
                        get {
                                return (uint) Args[1];
                        }
                }

        }
}

---
Not right at all.  I need a set method.  Should I just hand code this?

Another problem that I've run into is that GtkMozEmbed.EmbedWidget is
NULL when the signal is thrown.  I have to put a widget into this as a
return value of sorts.

I'm trying to find a way to avoid hacking gtk internals to get this to
work, since I apparently get my patches into mozilla proper.

I can't think of any other GTK+ widgets that behave this way off the
top of my head.  Anyone had to deal with one like this, and have a way
around it?

Mark

--0F1p//8PRICkK4MW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)

iD8DBQE+3jJ6Ofj2Ja/u/oARAjHhAKC7ZKFOhWQd+GbaXf2CsyXMoRY1MgCgklNk
wZz3RvmqdEIM+gqT4bRk/i0=
=E0TH
-----END PGP SIGNATURE-----

--0F1p//8PRICkK4MW--