PureBasic Forum
https://www.purebasic.fr/english/

qt trackbargadget
https://www.purebasic.fr/english/viewtopic.php?f=15&t=73452
Page 1 of 1

Author:  Azur [ Wed Aug 21, 2019 7:41 pm ]
Post subject:  qt trackbargadget

Hello
Am I doing it bad ?

setGadgetAttribute
#pb_trackbar_maximum
#pb_trackbar_minimum

seems to be inverted when using Qt subSystem

Code:
EnableExplicit

Define win.l, slider.l

win.l = OpenWindow(#PB_Any, 0, 0, 800 ,240, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
slider.l = TrackBarGadget(#PB_Any, 10, 10, 640, 16, 0, 100)

SetGadgetAttribute(slider.l, #PB_TrackBar_Maximum, 100) ; switch those
SetGadgetAttribute(slider.l, #PB_TrackBar_Minimum, 0)   ; values

Repeat
  Select(WaitWindowEvent(10))
    Case #PB_Event_CloseWindow
      End
  EndSelect
ForEver


made a quick search in the bug section without result

Author:  mk-soft [ Thu Aug 22, 2019 2:09 am ]
Post subject:  Re: qt trackbargadget

No problem here...

Only on X64 you can't use long ".l". Use always integer ".i"

Code:
EnableExplicit

Define win.i, slider.i

win.i = OpenWindow(#PB_Any, 0, 0, 800 ,240, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
slider.i = TrackBarGadget(#PB_Any, 10, 10, 640, 16, 0, 100)

SetGadgetAttribute(slider.i, #PB_TrackBar_Maximum, 200) ; switch those
SetGadgetAttribute(slider.i, #PB_TrackBar_Minimum, 0)   ; values

Repeat
  Select(WaitWindowEvent(10))
    Case #PB_Event_CloseWindow
      Break
    Case #PB_Event_Gadget
      Select EventGadget()
        Case slider
          Debug GetGadgetState(slider)
      EndSelect
     
  EndSelect
ForEver

Author:  Azur [ Thu Aug 22, 2019 6:02 pm ]
Post subject:  Re: qt trackbargadget

Hello thanks for the answer.
Your code does not work for me if i use Qt subsystem in the compiler options, the trackbar is stuck.
I have to invert maximum and minimum for the trackbar gadget

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/