Method: Fox::Canvas::ShapeCanvas#initialize
- Defined in:
- lib/fox16/canvas.rb
#initialize(p, tgt = nil, sel = 0, opts = FRAME_NORMAL, x = 0, y = 0, w = 0, h = 0) ⇒ ShapeCanvas
Returns a new instance of ShapeCanvas.
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/fox16/canvas.rb', line 375 def initialize(p, tgt=nil, sel=0, opts=FRAME_NORMAL, x=0, y=0, w=0, h=0) # Initialize base class super(p, tgt, sel, opts, x, y, w, h) # Start with an empty group @scene = ShapeGroup.new # Selection policy @selectionPolicy = SingleSelectionPolicy.new(self) @flags = 0 # Map FXMAPFUNC(SEL_PAINT, 0, "onPaint") FXMAPFUNC(SEL_MOTION, 0, "onMotion") FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftBtnPress") FXMAPFUNC(SEL_LEFTBUTTONRELEASE, 0, "onLeftBtnRelease") FXMAPFUNC(SEL_CLICKED,0,"onClicked") FXMAPFUNC(SEL_DOUBLECLICKED,0,"onDoubleClicked") FXMAPFUNC(SEL_TRIPLECLICKED,0,"onTripleClicked") FXMAPFUNC(SEL_COMMAND,0,"onCommand") end |