[fxruby-users] is there a memory limitation on fxruby-mswin32 ?
Erdwin Lianata
erdwin.lianata at yahoo.com.sg
Mon Aug 11 00:26:14 EDT 2008
Hi All,
I wonder is there a memory limitation on fxruby-mswin32 ?
I build an application which uses a lot of checkboxes, it seems running
well on Linux...but it crashes on Windows.
Would you please try to run the following code...
========= HERE IS THE CODE ========
require 'fox16'
include Fox
class CheckersView < FXMatrix
def initialize(parent)
super(parent, 10, :opts => MATRIX_BY_COLUMNS)
5.times { 10.times {
FXCheckButton.new(self, '', :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
} }
end
end
class TestView < FXMainWindow
def initialize(app)
super(app, 'Test Memory App', :opts => DECOR_ALL,
:width => 600, :height => 600)
vframe = FXVerticalFrame.new(self, LAYOUT_FILL)
FXButton.new(vframe, 'Add') do |button|
button.connect(SEL_COMMAND) do
add_table(@frame, true)
@frame.parent.layout
puts "add_table"
end
end
@counter = 1
FXScrollWindow.new(vframe, LAYOUT_FILL) do |scroll|
@frame = FXVerticalFrame.new(scroll, LAYOUT_FILL)
93.times { add_table(@frame) }
end
end
def add_table(table_parent, with_create=false)
vframe = FXVerticalFrame.new(table_parent)
label = FXLabel.new(vframe, @counter.to_s)
matrix = FXMatrix.new(vframe, 3, :opts => MATRIX_BY_COLUMNS)
CheckersView.new(matrix)
FXVerticalFrame.new(matrix)
CheckersView.new(matrix)
vframe.create if with_create
@counter += 1
end
def create
super
show(PLACEMENT_SCREEN)
end
end
FXApp.new do |app|
TestView.new(app)
app.create
app.run
end
========= END OF CODE ========
Here I create 93 rows whose each row has 2 table and each table consists
of 50 checkboxes. At the topmost of window is a button that is intended
to add a new row. The application will crash if the total of rows reach 95.
Sometimes it gives a "[BUG] Segmentation fault" messsage which points to
FXMatrix's constructor (kwargs.rb). But sometimes it will silently hang,
at this moment you can check that the output of "add_table" isn't
printed even though the button was clicked.
My Windows spesifications are RubyOneClickInstaller-1.8.26 and lib
FXRuby-1.6.12 which come along with the installer.
I can run the code on Linux, I even can test it with given 150 rows and
it's still running well. My Linux specifications are Ruby-1.8.5 and
installed gem fxruby-1.6.15.
Any workaround for this issue?
Thanks,
Erdwin
More information about the fxruby-users
mailing list