Hello All !
I am new to mono and GTK# (I am a C++ developer) and I need to
understand something about events handler.
I hope I am in the right place to ask such a question ... If not sorry
for inconvenience !
The way a method is attached to an event seems equivalent in class
Test1 and Test2 below :
class Test1
{
static void Main()
{
...
...
button1.Clicker += new EventHandler(hello_event);
}
public static void hello_event( object o, EventArgs e)
{
Console.WriteLine("Button press");
}
}
class Test2
{
static void Main()
{
...
...
button1.Clicker += hello_event;
}
public static void hello_event( object o, EventArgs e)
{
Console.WriteLine("Button press");
}
}
Can a method (in our case hello_event) be attached to a GTK# event
without instantiating a delegate (new EventHandler(hello_event); ) ?
I have a lots of example on mono's web site and on the web where
methods are attached without invoking the "new EventHandler" syntax,
but I haven't seen any specification or documentation which explicitly
say so (and I have looked for ;-) ).
Any body can help me understanding this ?
Thank you very much in advance !
Cheers,
Chicha
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list