[5.10b5] Live scroll events with WindowCallBack()

Mac OSX specific forum
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

[5.10b5] Live scroll events with WindowCallBack()

Post by Niffo »

Not sure it is a bug but should not we have realtime scroll events in the WindowCallBack ? Actually, there is only an event when releasing the mouse.

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "Test")
ScrollBarGadget(0, 10, 10, 200, 20, 0, 100, 10)

ProcedureC WindowCallback(Event, Window, Gadget, EventType)
   Debug "WindowCallback()"
EndProcedure

SetWindowCallback(@WindowCallback(), 0)

Repeat
   Select WaitWindowEvent()
      Case #PB_Event_Gadget
         Select EventGadget()
            Case 0
               Debug "ScrollBar Event"
         EndSelect
      Case #PB_Event_CloseWindow
         Break
   EndSelect
ForEver
Niffo
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by Niffo »

Same for TrackBarGadget ...
Niffo
wombats
Enthusiast
Enthusiast
Posts: 722
Joined: Thu Dec 29, 2011 5:03 pm

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by wombats »

Would it be possible to add scrollbar support to WindowCallback()? I can't seem to get live scrollbar events working nicely on OS X. ):
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by wilbert »

wombats wrote:I can't seem to get live scrollbar events working nicely on OS X. ):
As long as it isn't supported, you can use a workaround.
http://www.purebasic.fr/english/viewtop ... 25#p411225
The second more simple example might do for you. It adds a callback for the left mouse dragged event.
You will still have to perform a check yourself if a gadget value has changed but it's better than nothing.
Windows (x64)
Raspberry Pi OS (Arm64)
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by Fred »

We will add new commands for the next version to handle all live events.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by Polo »

Fred wrote:We will add new commands for the next version to handle all live events.
:D
wombats
Enthusiast
Enthusiast
Posts: 722
Joined: Thu Dec 29, 2011 5:03 pm

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by wombats »

wilbert wrote:
wombats wrote:I can't seem to get live scrollbar events working nicely on OS X. ):
As long as it isn't supported, you can use a workaround.
http://www.purebasic.fr/english/viewtop ... 25#p411225
The second more simple example might do for you. It adds a callback for the left mouse dragged event.
You will still have to perform a check yourself if a gadget value has changed but it's better than nothing.
Thanks for that.
Fred wrote:We will add new commands for the next version to handle all live events.
:D Brilliant news!
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [5.10b5] Live scroll events with WindowCallBack()

Post by Fred »

Now supported trough BindEvent()
Post Reply