Page 1 of 1

mouseleave on canvas-gadget ( intel mac ) ( pb 4.60 b3 )

Posted: Tue Jun 21, 2011 6:51 pm
by delikanli_19_82
hello guys,

i think, this is a bug, but before i report it as a bug, i do what freak says in his article about bugs. maybe its really a knowledge leck.

here the problem:

the MouseLeave-Event on Mac OS X doens't work, while it works without any problem on windows and linux.

Here my system information:

Mac OS X Snow Leopard ( 10.6.7 ) German, Intel x86.

PureBasic 4.60 Beta 3 x68.

No subsystem selected. Standard settings.

test code:

Code: Select all

Enumeration
  #window = 0
  #canvas = 1
EndEnumeration

Define event.l

OpenWindow( #window, 0, 0, 100, 100, "Canvas-Prob", #PB_Window_SystemMenu | #PB_Window_ScreenCentered )

CanvasGadget( #canvas, 10, 10, 80, 80 )

StartDrawing( CanvasOutput( #canvas ) )
  Box( 0, 0, 80, 80, RGB( 70, 70, 130 ) )
StopDrawing()

Repeat
  
  event = WaitWindowEvent()
  
  If event = #PB_Event_Gadget And EventGadget() = #canvas
    
    Select EventType()
        
      Case #PB_EventType_MouseEnter
        
        SetWindowTitle( #window, "On" )
        
      Case #PB_EventType_MouseLeave
        
        SetWindowTitle( #window, "Off" )
        
    EndSelect
    
  EndIf
  
Until event = #PB_Event_CloseWindow
any ideas?

Re: mouseleave on canvas-gadget ( intel mac ) ( pb 4.60 b3 )

Posted: Tue Jun 21, 2011 10:54 pm
by jamirokwai
Hi there,

seems to be a bug. If you make the window 200x200 px, the off-event for mouse_leave does not fire.

Re: mouseleave on canvas-gadget ( intel mac ) ( pb 4.60 b3 )

Posted: Thu Jun 30, 2011 10:32 am
by Shardik
As long as this bug is not fixed you may use this workaround:
http://www.purebasic.fr/english/viewtop ... 93&start=1

Re: mouseleave on canvas-gadget ( intel mac ) ( pb 4.60 b3 )

Posted: Sat Mar 10, 2012 3:30 pm
by Demivec
delikanli_19_82 wrote:the MouseLeave-Event on Mac OS X doens't work, while it works without any problem on windows and linux.
PB Manual on the topic of CanvasGadget wrote:On Windows and Linux, mouse events are reported while the mouse is down even if the mouse leaves the gadget. This ensures that a mouse down event is paired with a corresponding mouse up event even if the mouse is released outside of the gadget area. On Mac OSX, there are no events reported while the mouse is outside of the gadget, so it is possible to miss the mouse up event. A solution to this problem is to watch for the #PB_EventType_MouseLeave event and treat that as a mouse up event or to clip the mouse to the gadget area while the mouse is down, which ensures that the mouse up event is received.
Not a bug.