[fxruby-users] drawing on canvas

Raj Sahae rajsahae at gmail.com
Sun Mar 11 16:41:14 EDT 2007


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?



More information about the fxruby-users mailing list