Re: event macro/handler/listener syntax
[email protected] (Robert Roebling)
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
Bryan Bulten schrieb:
>
> > I wonder what the reasoning was, not to do
> > the same for the C# bindings. Is the AddListener()
> > syntax some sort of "native" C# way to connect
> > events to handlers or is it impossible to use
> > macros of some sort in C#?
>
> C# actually has its own way of handling events,
> called Delegates, which will probably be used for
> event handling in the future,
OK.
> From what I know, C# doesn't have the macro
> abilities available in C/C++.
I don't think we need macros in the proper sense
as they are used in C. Rather, if we add a function
wxEvtHandler::EVT_COMBO( int id, function func )
{
AddCommandListener( Event.ComboBox, id, new EventListener( func )
);
}
to wxEvtHandler then we could make the code look
exactly like under C++, Python and Perl. What do
you think? (I don't know what argument type a
function/method actually is).
Robert
--
Robert Roebling, MD <[email protected]>
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en