wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Wxruby-dev] Wait! Not ready for release


From: Curt Hibbs
Subject: RE: [Wxruby-dev] Wait! Not ready for release
Date: Sun, 29 Jun 2003 14:34:55 -0500

Kevin Smith wrote:
>
> Until now, you set up an event like this:
>     evt_menu(self, ID_FILE_QUIT,  "onQuit")
>
> This would be in your MyFrame class, and it says that any menu events
> with an ID of ID_FILE_QUIT, should invoke MyFrame#onQuit(event).
> Unfortunately, this means that you _must_ create a method for each kind
> of event you want to handle, even if the code is trivial.
>
> My new approach looks like this:
>     evt_menu(ID_FILE_QUIT) { onQuit }
> or
>     evt_menu(ID_FILE_QUIT) { |event| onQuit(event) }
>
> Much simpler and more rubyesque. And if you really don't care about the
> event (which is true 90% of the time), you don't have to pass it.

This is the kind of thing that will make using wxRuby a pleasure --
excellent!

Curt
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.486 / Virus Database: 284 - Release Date: 5/29/2003





reply via email to

[Prev in Thread] Current Thread [Next in Thread]