And I have no idea how to get this canvas working.
I''ve been looking at the scribble.rb example and trying to work off
that.
I get a seg fault when I run the method. @canvas is an instance of
FXCanvas.
def display
FXDCWindow.new(@canvas) do |dc|
@torus.grid.each_with_index do |row, y|
row.each_with_index do |part, x|
if part == :vapor
dc.foreground = "blue"
dc.drawPoint(x, y)
elsif part == :vacuum
dc.foreground = "black"
dc.drawPoint(x, y)
elsif part == :ice
dc.foreground = "gray"
dc.drawPoint(x, y)
end
end
end
end
end
What am I missing here?
On 3/11/07, Raj Sahae <rajsahae at gmail.com> wrote:> And I have no idea how to get this canvas working. > I''ve been looking at the scribble.rb example and trying to work off that. > > I get a seg fault when I run the method. @canvas is an instance of > FXCanvas.<snip> Raj, I don''t see anything obviously wrong with the code, but it may depend on the context from which the method is called. For example: At the time the method is called (and causes the segfault), has the canvas pointed to by @canvas actually been created yet?