Ejemplo n.º 1
0
        static void ConnectActivate(GLib.GType gtype)
        {
            if (ActivateMarshalCallback == null)
            {
                ActivateMarshalCallback = new GLib.ClosureMarshal(ActivateMarshal_cb);
            }

            GtkWidgetClass klass = GetClassStruct(gtype, false);

            klass.ActivateSignal = GLib.Object.RegisterSignal("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
            OverrideClassStruct(gtype, klass);
        }
Ejemplo n.º 2
0
        static void ConnectActivate(GLib.GType gtype)
        {
            if (ActivateMarshalCallback == null)
                ActivateMarshalCallback = new GLib.ClosureMarshal (ActivateMarshal_cb);

            GtkWidgetClass klass = GetClassStruct (gtype, false);
            klass.ActivateSignal = GLib.Object.RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
            OverrideClassStruct (gtype, klass);
        }
Ejemplo n.º 3
0
        protected static uint RegisterSignal(string signal_name, GLib.GType gtype, GLib.Signal.Flags signal_flags, GLib.GType return_type, GLib.GType[] param_types, GLib.ClosureMarshal marshaler)
        {
            IntPtr[] native_param_types = new IntPtr [param_types.Length];
            for (int parm_idx = 0; parm_idx < param_types.Length; parm_idx++)
            {
                native_param_types [parm_idx] = param_types [parm_idx].Val;
            }

            IntPtr native_signal_name = GLib.Marshaller.StringToPtrGStrdup(signal_name);

            try {
                IntPtr closure = marshaler != null?GLib.SignalClosure.CreateClosure(marshaler) : IntPtr.Zero;

                return(g_signal_newv(native_signal_name, gtype.Val, signal_flags, closure, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, return_type.Val, (uint)param_types.Length, native_param_types));
            } finally {
                GLib.Marshaller.Free(native_signal_name);
            }
        }