Live reporting of window moving?

Windows specific forum
ozzie
Enthusiast
Enthusiast
Posts: 429
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Live reporting of window moving?

Post by ozzie »

If I monitor the event #PB_Event_MoveWindow then this fires only when the window move has finished, ie when the user releases the mouse button. Is it possible to get live or continuous notifications as the window is moved? Can I do this by checking something in a window callback?
User avatar
skywalk
Addict
Addict
Posts: 3997
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Live reporting of window moving?

Post by skywalk »

v5.30
- Changed: #PB_Event_SizeWindow and #PB_Event_MoveWindow are no more realtime on Windows, use BindEvent() to get real time update. It should fixes ugly flickering when realtime resizing on Windows.
Or use SetWindowCallBack().
Last edited by skywalk on Fri Oct 24, 2014 2:06 am, edited 1 time in total.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Live reporting of window moving?

Post by Thunder93 »

Code: Select all

Procedure MoveWndEvent()
  WinID = EventWindow()
  
  Debug "xPos: "+ WindowX(WinID)
  Debug "yPos: "+ WindowY(WinID)
EndProcedure

OpenWindow(1,200,200,200,200,"Test",#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_SystemMenu)
WindowBounds(1,200,200,200,200)

BindEvent(#PB_Event_MoveWindow ,@MoveWndEvent(), 1)

Repeat
  Event = WaitWindowEvent(50)
  Event_Gadget = EventGadget()
Until Event = #PB_Event_CloseWindow
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
ozzie
Enthusiast
Enthusiast
Posts: 429
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: Live reporting of window moving?

Post by ozzie »

Many thanks. That's perfect. I'll have to learn a bit more about BindEvent()!
Post Reply