From: dmg@... (David Martinez) Date: 2002-04-17T18:45:19+09:00 Subject: Re: Floating icons over FXCanvas area "Lyle Johnson" wrote in message news:... > > I am trying to draw a floating icon over a FXCanvas area using the > > SEL_MOTION, but I don't know how to manage the deletion of the > > previously drawn icon. > > Can't you just paint over the previous rectangle occupied by the icon (after > setting the paint color to the canvas background color)? Something like: > > def onMotion(sender, sel, event) > theCanvas = sender > dc = FXDCWindow.new(theCanvas, event) > # Paint over the old one > dc.foreground = theCanvas.backColor > dc.fillRectangle(oldX, oldY, theIcon.width, theIcon.height) > # Draw icon in its new position > dc.drawIcon(theIcon, event.rect.x, event.rect.y) > oldX, oldY = event.rect.x, event.rect.y > dc.end > end > > Hope this helps, > > Lyle The problem it is al little bit more dificult, because in my FXcanvas there are drawn shapes I want to pass over. I wold like to move the floating icon without redrawing the canvas, more or less like the cursor on the whole screen. Thanks.