wxRuby 0.3.0 has been released and is now available for download from RubyForge at: http://wxruby.rubyforge.org/ This release includes binary builds for Max OS X Panther and MS Windows. Hopefully, within a couple weeks I will release RubyGems for the source, and RubyGem binaries for Mac, Windows, and Linux. Please report any bugs or feature requests here: http://rubyforge.org/tracker/?group_id=35 Changes in this release include: * Added MDI support, and an MDI sample * Fixed MAJOR problems with Validators. * Cleaned up many method names and parameters. * Many bug fixes. * Added a note to controls/controls.rb sample explaining that the current get/set_client_data can segfault See the ChangeLog for a detailed list of changes. -------------- What is wxRuby? wxRuby is an open source GUI toolkit for the [Ruby] programming language. It provides a Ruby interface to the cross-platform wxWidgets C++ GUI framework (formerly known as wxWindows). wxRuby is intended to dramatically extend Ruby''s usefulness in rapid prototyping and general UI development. wxWidgets is a mature, cross-platform GUI toolkit that uses native GUI widgets. This means that wxRuby applications can integrate seamlessly on each supported platform, and can behave like the user expects. wxRuby is still in early beta. The adventurous can get the latest source code from the cvs repository, including nightly snapshots. wxRuby seems to work pretty well for a variety of test applications.
Lothar Scholz wrote:> > Hello Curt, > > Wednesday, April 21, 2004, 12:41:52 AM, you wrote: > > I get the following error from the splitter sample > > Z:\work\arachno\make>"C:\Program Files\Arachno Ruby > IDE\ruby\samples\wxRuby-0.3.0\splitter\splitter. > rb" > C:/Program Files/Arachno Ruby > IDE/ruby/samples/wxRuby-0.3.0/splitter/splitter.rb:257:in `main_loop'': > undefined method `on_draw'' for #<MyCanvas:0x2a54830> (NoMethodError) > from C:/Program Files/Arachno Ruby > IDE/ruby/samples/wxRuby-0.3.0/splitter/splitter.rb:257 > > All other samples seem to work fine.Thanks. I tried fixing the reported error. The main window displays just fine, but then it segfault''s when I try to resize the window. :-( I''m working on a wxRuby app that does have a working splitter in it. If you need an example, let me know and I''ll send it to you. Curt
Kevin Smith
2004-Apr-21 12:02 UTC
[Wxruby-users] wxRuby splitter sample problems (was: wxRuby 0.3.0 has been released!)
Curt Hibbs wrote:> Lothar Scholz wrote: >>I get the following error from the splitter sample >> >>IDE/ruby/samples/wxRuby-0.3.0/splitter/splitter.rb:257:in `main_loop'': >> undefined method `on_draw'' for #<MyCanvas:0x2a54830> (NoMethodError) >> from C:/Program Files/Arachno Ruby >>IDE/ruby/samples/wxRuby-0.3.0/splitter/splitter.rb:257Oops. The OnDraw member should have been renamed on_draw to match the wxRuby naming convention.> I tried fixing the reported error. The main window displays just fine, but > then it segfault''s when I try to resize the window. :-(Ouch. This is caused by memory not being handled correctly in the ScrolledWindow class of wxRuby. You can see this more easily if you insert a call to GC.start inside the on_draw method. Boom! In the ScrolledWindow class, We store "self" using SetClientData. But our SetClientData has a bug where if Ruby does a garbage collection, it will segfault. This known problem with get/set_client_data is mentioned in the README. I didn''t realize that we were also using SetClientData here, as this is some old code that I hadn''t yet looked at. I should be able to put in a quick fix within a day or two. The side effect will be that it will leak memory if you close a ScrolledWindow. In the long run, we plan to move wxRuby to SWIG, and this problem will automatically disappear when we do so. Thanks very much for the problem report! Sorry for the problems. Kevin
Kevin Smith
2004-Apr-24 02:15 UTC
[Wxruby-users] Crashes in wxRuby 0.3 (was: wxRuby splitter sample problems)
Kevin Smith wrote:> Oops. The OnDraw member should have been renamed on_draw to match the > wxRuby naming convention.I have checked in this fix.> Ouch. This is caused by memory not being handled correctly in the > ScrolledWindow class of wxRuby. You can see this more easily if you > insert a call to GC.start inside the on_draw method. Boom!I have also checked in a fix for this. However, a quick search revealed a similar bug in several other classes. This is all very old code, apparently written by someone who at that time didn''t quite understand the rules of Ruby''s memory management. Here are the affected classes and methods (as documented in the new README): * NOTE: The following classes have known problems that may cause crashes if you use set_client_data and/or get_client_data: Choice, ComboBox, CommandEvent, SocketEvent, EvtHandler, ListBox, Socket * NOTE: The following classes have known problems that may cause crashes if you use these methods: - Event (get_event_object) - ListCtrl (on_get_item_attr, on_get_item_image, on_get_item_text) - TreeCtrl (on_compare_items) I am slightly reluctant to fix all of these right now, because: 1. there are so many 2. each fix has to be custom-coded 3. testing to ensure each has really been fixed may be hard 4. wxruby-swig should be ready reasonably soon (and won''t have this problem), On the other hand, I do not want wxRuby to get a bad reputation. Perhaps it is worth fixing them, and releasing a 0.4 (or 0.3.1). Opinions? Kevin
Curt Hibbs
2004-Apr-24 02:57 UTC
[Wxruby-users] Crashes in wxRuby 0.3 (was: wxRuby splitter sampleproblems)
Kevin Smith wrote:> > I am slightly reluctant to fix all of these right now, because: > 1. there are so many > 2. each fix has to be custom-coded > 3. testing to ensure each has really been fixed may be hard > 4. wxruby-swig should be ready reasonably soon (and won''t have this > problem), > > On the other hand, I do not want wxRuby to get a bad reputation. Perhaps > it is worth fixing them, and releasing a 0.4 (or 0.3.1). > > Opinions?I guess this really hinges on when "reasonably soon" is likely to be. Are we talking a month? two months? four months? Curt