The height is ignored on ubuntu but PB will return the height you set
if there's a difference between distro's scrollbars then you may need to use the "size-allocate" signal
to get the gadgets dimensions
Code: Select all
Structure GtkRectangle
x.l
y.l
width.l
height.l
EndStructure
ProcedureC CBSizeRequest(*wid.GtkWidget,*rect.Gtkrectangle,*usedata)
Debug "x " + Str(*rect\x)
Debug "y " + Str(*rect\y)
Debug "width " + Str(*rect\width)
Debug "height " + Str(*rect\height)
EndProcedure
If OpenWindow(0, 0, 0, 305, 140, "ScrollBarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget (2, 10, 25, 250, 30, "ScrollBar Standard (start=50, page=30/100)",#PB_Text_Center)
ScrollBarGadget (0, 10, 42, 250, 20, 0, 100, 30)
g_signal_connect_(GadgetID(0),"size-allocate",@CBSizeRequest(),0)
SetGadgetState (0, 50) ; set 1st scrollbar (ID = 0) to 50 of 100
TextGadget (3, 10,115, 250, 20, "ScrollBar Vertical (start=100, page=50/300)",#PB_Text_Right)
ScrollBarGadget (1, 270, 10, 25, 120 ,0, 300, 50, #PB_ScrollBar_Vertical)
SetGadgetState (1, 100) ; set 2nd scrollbar (ID = 1) to 100 of 300
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf