[fxruby-users] I'm working on my graphics window for the ruby quiz

Lyle Johnson lyle.johnson at gmail.com
Sun Mar 11 08:08:04 EDT 2007


On 3/10/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.
>
> This is my display method, I get a seg fault when I run the method.
>
>   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

I don't see anything that is obviously wrong with it. It might help to
see the problem in context, though (i.e. in a complete program).


More information about the fxruby-users mailing list