Page 1 of 1

[5.10b5] Live scroll events with WindowCallBack()

Posted: Wed Jan 30, 2013 9:08 am
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

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

Posted: Wed Jan 30, 2013 9:30 am
by Niffo
Same for TrackBarGadget ...

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

Posted: Sat May 04, 2013 10:00 pm
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. ):

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

Posted: Sun May 05, 2013 5:28 am
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.

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

Posted: Sun May 05, 2013 1:35 pm
by Fred
We will add new commands for the next version to handle all live events.

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

Posted: Sun May 05, 2013 2:45 pm
by Polo
Fred wrote:We will add new commands for the next version to handle all live events.
:D

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

Posted: Sun May 05, 2013 3:25 pm
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!

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

Posted: Thu Sep 05, 2013 1:59 pm
by Fred
Now supported trough BindEvent()