I found some ugly legacy while working on wxruby-swig. wxBusyCursor, wxBusyInfo, and wxWindowDisabler all use a free method that directly calls the destructor. In the wxruby-swig version of these, I created a static method (named busy,busy, and disable) that runs an attached block while under the influence of the class. I suggest changing the wxruby we change API to match, and get rid of their constructors as well. Nick
Nick wrote:> > I found some ugly legacy while working on wxruby-swig. wxBusyCursor, > wxBusyInfo, and wxWindowDisabler all use a free method that directly > calls the destructor. In the wxruby-swig version of these, I created a > static method (named busy,busy, and disable) that runs an attached block > while under the influence of the class. I suggest changing the wxruby we > change API to match, and get rid of their constructors as well.Did you mean to say that we should change wxruby to match what you''ve done with wxruby-swig? I can go either way on that...depending on how soon we thing wxruby-swig will replace wxruby. Can you post a sample code fragment that shows how the new api would be used? Thanks, Kevin
> > Did you mean to say that we should change wxruby to match what you''ve > done with wxruby-swig? I can go either way on that...depending on how > soon we thing wxruby-swig will replace wxruby. >wxruby - I''ve got wxruby-swig covered.> Can you post a sample code fragment that shows how the new api would > be used?Sure! # # Assuming self is a wxWindow subclass # BusyCursor.busy(self) do # Put code in here you want to happen with a busy cursor end WindowDisabler.disable(self) do # # Put code here you want to happen with the window disabled. # end BusyInfo.busy("I''m Busy! Go away!", self) do # # Put code to execute with message up # end Nick
Reasonably Related Threads
- wxRuby 0.6.0 is released!
- [801] trunk/wxruby2/doc/textile: Explain how to use the block-style class methods in these classes
- SWIG compilation
- find_window_by_xxx doesn''t find Gauge or BitmapButton
- [1085] trunk/wxruby2/swig: Add checks and ruby exceptions for two common Wx::Window mistakes leading to