Alex Fenton wrote:> Just for reference, it should be Wx::PLATFORM now (from > swig/RubyConstants). If scripts are referring to RUBY_PLATFORM, they are > referring to Ruby''s constant in the main namespace (eg i686-mswin) not > our WXMSW. I find the const confusion one reason not to ''include Wx'' in > samples, but appreciate it''s a matter of taste.Yes. I prefer not to include Wx because of various possible namespace collisions. However, we should probably have at least one sample (maybe minimal.rb) written two ways--one with include Wx and the other without. That way people could see the difference and decide for themselves. Also, we could point to the one with the include if we are trying to stress how easy and friendly wxruby app code can look. Just a thought. Kevin
Kevin Smith wrote:> Yes. I prefer not to include Wx because of various possible namespace > collisions.On reflection, it''s probably also a matter of the size of application being written. In a sample, we''re usually calling the core classes directly, so ''include Wx'' is a useful repetition-saver. In a big ''real'' app (like Weft) it''s more usual to use subclasses. This means it''s more important to see where constants are coming from, and reduces the repetition b/c the references to constants (eg style constants) are encapsulated within the subclass methods (eg constructors). So ''include Wx'' makes less sense.> However, we should probably have at least one sample (maybe > minimal.rb) written two ways--one with include Wx and the other without. >Agreed.> Also, we could point to the one with the include if we are trying to > stress how easy and friendly wxruby app code can look. >Yep, sounds good. alex
Reasonably Related Threads
- Wx::TextCtrl and wxMSW
- error finding library when running test program
- Re: Problem building wxRuby: htmlproc.h not found
- [733] trunk/wxruby2: Updated with changes made to samples.
- [703] trunk/wxruby2/Changelog: Get/SetStipple for Wx::Pen; faster building on dual core; MDI sample bugs on OS X