On Thu, 2006-08-10 at 19:10 +0100, Alex Fenton wrote:> One general issue is that many of the samples rely on being run from
> their own directory, but don''t enforce this. How do people feel
about
> samples doing:
>
> Dir.chdir( File.dirname( __FILE__ ) )
>
> if the sample should be run from the current directory only?
Hm. I''m not too fond of that approach, but wouldn''t fight
against it.
> Alternately, some can be recoded to load resources relative to the
> script dir, not the dir that ruby was run from, and fixed in this way.
I think that''s probably the best option.
The other approach, which I took with one of the samples, is to simply
refuse to run if the current directory is wrong. That might be a quick
and dirty solution for this alpha release (or shortly after).
> Notes on individual scripts
Thanks for doing this. I haven''t looked at all the samples for a long
time, and it''s nice to see how many of them do work well.
> - bigdemo.rb
> Mostly OK, and a nice script as well. But issues when not run from
> current dir. Also some items don''t quite display right in the
little
> pane (eg Wx::Choice)
I really like bigdemo, but it doesn''t seem to work as well for me as it
does for you. Platform issues, perhaps?
First, it would be great if we could rename Main.rbw to bigdemo.rb(w) to
be more consistent with the other samples.
Within a couple minutes of starting bigdemo, it always crashes,
presumably due to a garbage collection issue. The crash handler then
falls into a loop of:
addr2line: ''wxruby'': No such file
And then pops up a dialog offering to terminate the app. The wxGauge
demo seems to make it happen right away.
I get a segfault when pressing the "MDI demo" button:
(wxruby:25518): Gtk-CRITICAL **: gtk_window_realize_icon: assertion
`info->icon_pixmap == NULL'' failed
./MDIDemo.rbw:21: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i486-linux]
Changing fonts crashes:
(wxruby:25723): Gtk-CRITICAL **: gtk_window_set_transient_for: assertion
`parent == NULL || GTK_IS_WINDOW (parent)'' failed
./wxFontDialog.rbw:80:in `set_label'': can''t convert nil into
String
(TypeError)
from ./wxFontDialog.rbw:80:in `update_ui''
from ./wxFontDialog.rbw:104:in `on_select_font''
from ./wxFontDialog.rbw:8:in `initialize''
from Main.rbw:551
./wxFontDialog.rbw:80: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i486-linux]
The text for PopupMenu should say that you have to right-click in the
blank area around the text. I tried clicking inside the text and nothing
happened, but then I tried outside and it worked fine.
wxComboBox pops up an error dialog
A problem occurred with the wxComboBox demo:
No matching function for overloaded ''wxComboBox_Append''
./wxComboBox.rbw:22:in `append''
./wxComboBox.rbw:22:in `initialize''
./wxComboBox.rbw:52:in `run''
Main.rbw:396:in `run_demo''
Main.rbw:356:in `on_tree_sel_changed''
Main.rbw:287:in `initialize''
Main.rbw:551
The scrolling list jumps farther than it should for a mouse wheel
movement. It should be 2-3 items but is 6. I''m not sure if
that''s set in
ruby code or is part of wx.
wxScrolledWindow fails:
./wxScrolledWindow.rbw:49:in `do_drawing'': undefined method
`get_text_extent'' for #<Wxruby2::PaintDC:0xb67e5964>
(NoMethodError)
from ./wxScrolledWindow.rbw:35:in `on_paint''
from ./wxScrolledWindow.rbw:26:in `initialize''
from Main.rbw:551
wxStatusBar brings up an error dialog, and then immediately goes to the
loop/terminate problem mentioned above. I can''t copy the error message,
but the short version is that set_status_text hits a "Swig director type
mismatch in output value of type ''bool''"
wxTextCtrl crashes:
./wxTextCtrl.rbw:11:in `on_kill_focus'': undefined method
`write'' for
#<WxRubyDemo:0xb689bd6c> (NoMethodError)
from ./wxTextCtrl.rbw:31:in `initialize''
from Main.rbw:416:in `run_demo''
from Main.rbw:356:in `on_tree_sel_changed''
from Main.rbw:287:in `initialize''
from Main.rbw:551
./wxTextCtrl.rbw:11: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i486-linux]
wxToggleButton gives an error dialog:
A problem occurred with the wxToggleButton demo:
undefined method `evt_togglebutton'' for #<TestPanel:0xb67e8b4c>
./wxToggleButton.rbw:11:in `initialize''
./wxToggleButton.rbw:9:in `initialize''
./wxToggleButton.rbw:26:in `run''
Main.rbw:396:in `run_demo''
Main.rbw:356:in `on_tree_sel_changed''
Main.rbw:287:in `initialize''
Main.rbw:551
wxTreeControl gives an error dialog:
A problem occurred with the wxTreeCtrl demo:
undefined method `get_icon'' for Wxruby2::ArtProvider:Class
./wxTreeCtrl.rbw:57:in `initialize''
./wxTreeCtrl.rbw:160:in `run''
Main.rbw:396:in `run_demo''
Main.rbw:356:in `on_tree_sel_changed''
Main.rbw:287:in `initialize''
Main.rbw:551
wxLayoutConstraints doesn''t appear to be doing the right thing, but
it''s
hard to tell since I don''t know what the right thing is. I have a big
purple area, but the upper left square centimeter is green, with the
letters "Pa" in it.
I tried Help/Find, and when I hit OK I crashed with:
Illegal instruction
> - caret.rb
> OK - but arrow keys don''t work properly (should they?)
After there is text entered, the arrow keys work fine for me.
> - dialogs.rb
> Problems with DC - seems to cause ObjectPreviouslyDeleted error in an
> on_paint handler. I have worked round this. MDI, ColourDialog crashes on
> OS X.
I have no trouble with DC or the color dialog. But the Busy Info dialog
puts up an ugly gray box (with no border filled with question marks. If
you hit Cancel from the Find (or Find/Replace) dialog, the app segfaults
and exits immediately, so the only way out is the not-quite-obvious X
close button.
The text for the modeless dialog should make it more clear which menu
you are supposed to use to close the dialog (It''s the main menu of the
app, not the window menu of the modeless dialog).
> - listbook.rb
> OK, except breaks if not run from own directory.
Brings up a big blank window for me. If this is only available on
certain platforms, we should say so.
> - mdi.rb
> MDI doesn''t work on OS X?
Segfaults for me before the main frame is shown.
> - minimal.rb
> OK - have tidied up and commented a bit more, commit pending
The title bar of nothing.rb should probably not say "Minimal", since
it
is quite different from the minimal sample.
Kevin