When I run this program:
require 'fox16'
include Fox
class ModelWindow < FXMainWindow
# The default height and width of the
main window, in pixels
WINDOW_HEIGHT = 800
WINDOW_WIDTH = 1000
WINDOW_X = 80
WINDOW_Y = 110
def create
super
show
end # of method create
def initialize(app, titleString)
# Create the main window
super(app, titleString, :x
=> WINDOW_X,
:y =>
WINDOW_Y,
:width => WINDOW_WIDTH,
:height => WINDOW_HEIGHT)
# Terminate the program when the
main window is closed. If we omit this,
# then closing the window results
in a return to the "main" program in
# WSCI_Model.rb
self.connect(SEL_CLOSE) do
exit(0)
end
# Split the main window into two
panes, the left and right panes, and
# then in each pane create a frame
that allows us to create windows
# vertically (i.e. above one another).
splitter = FXSplitter.new(self, :opts
=> SPLITTER_HORIZONTAL|LAYOUT_FILL)
@left = FXVerticalFrame.new(splitter,
:width =>
WINDOW_WIDTH/2,
:opts =>
LAYOUT_TOP|
LAYOUT_FIX_WIDTH|
LAYOUT_FILL_Y|
FRAME_SUNKEN)
@right = FXVerticalFrame.new(splitter,
:opts =>
LAYOUT_TOP|LAYOUT_FILL|FRAME_SUNKEN)
leftSplit = FXSplitter.new(@left, :opts
=> SPLITTER_VERTICAL|LAYOUT_FILL)
leftTop = FXVerticalFrame.new(leftSplit,
:height
=> (WINDOW_HEIGHT*7)/10,
:opts =>
LAYOUT_TOP|
LAYOUT_FIX_HEIGHT|
LAYOUT_FILL_X|
FRAME_SUNKEN)
@leftBottom = FXVerticalFrame.new(leftSplit,
:opts => LAYOUT_BOTTOM|
LAYOUT_FILL_X|
FRAME_SUNKEN)
# In the top pane, create the
main text output (console) window. We do
# not specify WORDWRAP - the text
is then scrollable sideways.
$mainText = FXText.new(leftTop,
:opts => LAYOUT_FILL|
TEXT_READONLY|
FRAME_NONE)
# Create the command area and
button in the lower left-hand pane
commandGroup = FXGroupBox.new(@leftBottom,
"Command:",
:opts =>
LAYOUT_FILL_X|
GROUPBOX_TITLE_CENTER|
FRAME_RIDGE)
# Now a vertical frame
commandVert = FXVerticalFrame.new(commandGroup,
:opts => LAYOUT_FILL_X|FRAME_NONE)
end # of method initialize
end # of Class ModelWindow
#-------------------------------------------------------------------------------
$fxApp = FXApp.new
$ModelWindow = ModelWindow.new($fxApp, "Test")
$fxApp.create
$fxApp.run
exit(0)
on Red Hat EnterPrise Linux 5.3, 64-bit,
with Ruby 1.9.1, FXRuby 1.16.19 and FOX 1.6.36, when I close the window
(by clicking on the "X" in the top rh corner), Ruby crashes.
Here is the log from the Linux terminal window:
ruby -w test.rb
/usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/lib/fox16/core.rb:209:
warning: mismatched indentations at 'end' with 'def' at 207
/usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/lib/fox16/core.rb:210:
warning: mismatched indentations at 'end' with 'class' at 205
<main>: [BUG] Segmentation fault
ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux]
-- control frame ----------
c:0001 p:0000 s:0002 b:0002 l:000e78 d:000e78 TOP
---------------------------
-- Ruby level backtrace information-----------------------------------------
-- C level backtrace information -------------------------------------------
0x4d6491 ruby(rb_vm_bugreport+0x41) [0x4d6491]
0x500f9e ruby [0x500f9e]
0x501101 ruby(rb_bug+0xb1) [0x501101]
0x48b47f ruby [0x48b47f]
0x395b20e4c0 /lib64/libpthread.so.0 [0x395b20e4c0]
0x4909f6 ruby(st_lookup+0x26) [0x4909f6]
0x4c6815 ruby [0x4c6815]
0x4c6863 ruby(rb_get_method_body+0x23) [0x4c6863]
0x4d26ea ruby(rb_funcall+0x17a) [0x4d26ea]
0x2aaaab40ab81 /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_Z18FXRbCallVoidMethodPN2FX8FXObjectEm+0x5d)
[0x2aaaab40ab81]
0x2aaaab1eceb8 /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN12FXRbGroupBox6recalcEv+0x40)
[0x2aaaab1eceb8]
0x2aaaabbd3e5d /usr/local/lib/libFOX-1.6.so.0(_ZN2FX8FXWindowD2Ev+0x13d)
[0x2aaaabbd3e5d]
0x2aaaab41f3c3 /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN2FX8FXPackerD2Ev+0x27)
[0x2aaaab41f3c3]
0x2aaaab41f5a3 /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN2FX15FXVerticalFrameD2Ev+0x27)
[0x2aaaab41f5a3]
0x2aaaab428e49 /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN17FXRbVerticalFrameD0Ev+0x39)
[0x2aaaab428e49]
0x2aaaab4a4dac /usr/local/lib/ruby/gems/1.9.1/gems/fxruby-1.6.19/ext/fox16/fox16.so(_ZN10FXRbObject8freefuncEPN2FX8FXObjectE+0xf4)
[0x2aaaab4a4dac]
0x41b777 ruby [0x41b777]
0x41b8ff ruby [0x41b8ff]
0x41bac4 ruby(rb_gc_call_finalizer_at_exit+0x174)
[0x41bac4]
0x417c07 ruby(ruby_cleanup+0x147) [0x417c07]
0x417d5a ruby(ruby_run_node+0x3a) [0x417d5a]
0x4154cd ruby(main+0x4d) [0x4154cd]
0x395a61d974 /lib64/libc.so.6(__libc_start_main+0xf4)
[0x395a61d974]
0x4153c9 ruby [0x4153c9]
[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports
are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted
[toll@localhost Emu_Test]$
I have cut the program down as far as
I can - if you remove almost anything else, it no longer crashes).
Do you have any idea if this is a problem
in FXRuby with Ruby 1.9.1? Is this a problem with my 64-bit Linux
installation (i.e. did I get the installation wrong somehow)? Or,
as the log suggests, is this a bug in Ruby 1.9.1?
Note that this does NOT crash on 32-bit
ruby 1.8.6 under Windows XP.
Thanks
Dave
____________________________________________________________
David C. Toll, Research Staff Member
IBM T. J. Watson Research Center, 19 Skyline Drive, Hawthorne NY 10532
Phone: 914-784-7019 (t/l 863) Fax: 914-784-6205 (t/l 863) email:
toll@..._______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users