Flicker free window resize to minimum width/height - OSX

Mac OSX specific forum
HarrysLad
User
User
Posts: 57
Joined: Fri Jun 04, 2010 9:29 pm
Location: Sunny Spain

Flicker free window resize to minimum width/height - OSX

Post by HarrysLad »

This seems to have been asked before but I still can't find an answer.
It all works fine on Windows - the mouse cursor simply goes into the minimally-resized window and redrawing stops. With OSX though, the window resizes to the cursor and out to it's minimum size again - hence the flicker.
Any ideas or solutions would be very welcome.

While I'm here ... :)
I once found a method on this forum to set the mouse position but I can't seem to find it now.
Again, if someone could be so kind ...

Dave
User avatar
deseven
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Jan 12, 2011 3:48 pm
Location: Serbia
Contact:

Re: Flicker free window resize to minimum width/height - OSX

Post by deseven »

Code: Select all

OpenWindow(0,#PB_Ignore,#PB_Ignore,400,300,"WindowBounds",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
WindowBounds(0,300,200,500,400)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Otherwise you can use cocoa minSize/maxSize or window callback.
HarrysLad
User
User
Posts: 57
Joined: Fri Jun 04, 2010 9:29 pm
Location: Sunny Spain

Re: Flicker free window resize to minimum width/height - OSX

Post by HarrysLad »

Thanks for the reply. WindowBounds() eh? I don't know how I missed that. :oops:
Any clue on the mouse position (OSX) thing?

Dave
User avatar
deseven
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Jan 12, 2011 3:48 pm
Location: Serbia
Contact:

Re: Flicker free window resize to minimum width/height - OSX

Post by deseven »

Like that?

Code: Select all

ImportC ""
  CGWarpMouseCursorPosition(x.CGFloat,y.CGFloat)
EndImport

OpenWindow(0,#PB_Ignore,#PB_Ignore,400,300,"cursor movement",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ButtonGadget(0,10,10,200,30,"Move cursor to center")
ButtonGadget(1,190,260,200,30,"Move cursor to center")

Repeat
  ev = WaitWindowEvent()
  If ev = #PB_Event_Gadget
    CGWarpMouseCursorPosition(WindowX(0,#PB_Window_InnerCoordinate)+200,WindowY(0,#PB_Window_InnerCoordinate)+150)
  EndIf
Until ev = #PB_Event_CloseWindow
Post Reply