[Gtk-sharp-list] Emiting a FocusGrabbed signal in Mono

Matthew Pirocchi matthew.pirocchi at gmail.com
Wed Feb 17 13:58:38 EST 2010


I think this is what you want:

if (FocusGrabbed != null)
    FocusGrabbed (this, EventArgs.Empty);

In other words, you want to use "EventArgs.Empty" instead of "new
EventHandler()".

I hope this helps :)

On Mon, Feb 1, 2010 at 10:54 AM, Matt234 <ppinmatt at videotron.ca> wrote:

>
> I'm writing a composite widget and I would like it to send the FocusGrabbed
> event when the Entry it contains grabs the focus. However, I can't simply
> do:
>
> if (FocusGrabbed != null) FocusGrabbed (this, new EventHandler ())
>
> because I get a compiler error telling me that the event can only be on the
> left side of += or -=. Then I tried:
>
> Glib.Signal.Emit (this, "focus-in-event");
>
> but it does nothing but giving me a warning in the console:
> GLib-GObject-CRITICAL **: g_value_set_boolean: assertion
> `G_VALUE_HOLDS_BOOLEAN (value)' failed
> GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)'
> failed
>
> What am I doing wrong? Thanks :)
> --
> View this message in context:
> http://old.nabble.com/Emiting-a-FocusGrabbed-signal-in-Mono-tp27406413p27406413.html
> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
>
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20100217/1418ae1e/attachment.html 


More information about the Gtk-sharp-list mailing list