static int OutputSignalCallback(IntPtr inst, IntPtr gch) { Gtk.OutputArgs args = new Gtk.OutputArgs(); try { GLib.Signal sig = ((GCHandle)gch).Target as GLib.Signal; if (sig == null) { throw new Exception("Unknown signal GC handle received " + gch); } Gtk.OutputHandler handler = (Gtk.OutputHandler)sig.Handler; handler(GLib.Object.GetObject(inst), args); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException(e, false); } try { return((int)args.RetVal); } catch (Exception) { Exception ex = new Exception("args.RetVal or 'out' property unset or set to incorrect type in Gtk.OutputHandler callback"); GLib.ExceptionManager.RaiseUnhandledException(ex, true); // NOTREACHED: above call doesn't return. throw ex; } }
public void HandleOutput(object o, Gtk.OutputArgs args) { args.RetVal = 1; }
static int OutputSignalCallback (IntPtr inst, IntPtr gch) { Gtk.OutputArgs args = new Gtk.OutputArgs (); try { GLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal; if (sig == null) throw new Exception("Unknown signal GC handle received " + gch); Gtk.OutputHandler handler = (Gtk.OutputHandler) sig.Handler; handler (GLib.Object.GetObject (inst), args); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); } try { return ((int) args.RetVal); } catch (Exception) { Exception ex = new Exception ("args.RetVal or 'out' property unset or set to incorrect type in Gtk.OutputHandler callback"); GLib.ExceptionManager.RaiseUnhandledException (ex, true); // NOTREACHED: above call doesn't return. throw ex; } }