Page 1 of 1

pb 5b4 : trackbargadget is not realtime

Posted: Tue Oct 09, 2012 2:14 pm
by drgolf
on osx : the value change only when the mouse is released : not good
on windows : the value change when the trackbbar position change

Code: Select all

Enumeration 
  #Window_0
EndEnumeration

Enumeration 
  #text_0
  #tb_0
EndEnumeration


Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 290, 130, "", #PB_Window_SystemMenu)
  TextGadget(#text_0,10,10,50,20,"0",#PB_Text_Border|#PB_Text_Center)
  TrackBarGadget(#tb_0,10,70,150,25,0,100)
EndProcedure

initwindow_0()

Repeat
Select WaitWindowEvent()
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #tb_0
          SetGadgetText(#text_0,Str(GetGadgetState(#tb_0)))
      EndSelect
    Case #PB_Event_CloseWindow
      CloseWindow(#window_0)
      Break
  EndSelect
ForEver
End

Re: pb 5b4 : trackbargadget is not realtime

Posted: Tue Oct 09, 2012 5:26 pm
by Mindphazer
It's not specific to PB 5.00
It does the same on PB 4.61 and 4.60 (and probably versions below ; I don't have them anymore)

But... should it be considered as a bug ?

Re: pb 5b4 : trackbargadget is not realtime

Posted: Tue Oct 09, 2012 5:38 pm
by Polo
It's a missing feature I'd say, like live scrollbars on all OSes.

Re: pb 5b4 : trackbargadget is not realtime

Posted: Tue Oct 09, 2012 5:57 pm
by Mindphazer
I agree

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 11:56 am
by Fred
Unfortunately it doesn't work live on OS X, but we can't do anything about it.

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 12:38 pm
by wilbert
I assume it's the same problem you mentioned before about the PureBasic event queue being locked until you release the button ?
OS X itself calls the target/action also while the trackbar gadget is used.

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 2:51 pm
by Fred
Yes, it's the same issue.

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 4:06 pm
by IdeasVacuum
Oh well, looks like Apple are well on the way to self-destruct again, so it won't be a problem in the future :shock:

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 4:27 pm
by wilbert
IdeasVacuum wrote:Oh well, looks like Apple are well on the way to self-destruct again, so it won't be a problem in the future :shock:
It's not an OS X issue, it's a PureBasic issue.
Of course scrollbars and sliders are working realtime in the OS itself. 8)

Re: pb 5b4 : trackbargadget is not realtime

Posted: Wed Oct 10, 2012 4:51 pm
by IdeasVacuum
...it won't matter whose issue it is if the platform isn't there anymore - but I jest. :twisted:

Re: pb 5b4 : trackbargadget is not realtime

Posted: Fri Jan 03, 2014 3:10 pm
by gwhuntoon
Well, this response is way late but it's supported now in PB 5.21 with BindEvent. I modified the above example as follows and have only tested it in OSX Mavericks.

Code: Select all

Enumeration 
  #Window_0
EndEnumeration

Enumeration 
  #text_0
  #tb_0
EndEnumeration

Procedure GadgetHandler()
  SetGadgetText(#text_0,Str(GetGadgetState(#tb_0)))  
EndProcedure

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 290, 130, "", #PB_Window_SystemMenu)
  TextGadget(#text_0,10,10,50,20,"0",#PB_Text_Border|#PB_Text_Center)
  TrackBarGadget(#tb_0,10,70,150,25,0,100)
  
  BindEvent(#PB_Event_Gadget, @GadgetHandler())
EndProcedure


initwindow_0()

Repeat
Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      CloseWindow(#window_0)
      Break
  EndSelect
ForEver
End