although this is not confirmed it is probably a bug in resizing in gtk3
Test this code with gtk2 sublibrary first to se expected behaviour.
Then with gtk3, now you will see what I mean with resize bug, please check behaviour on scrollbars

Code: Select all
Structure VView
id.i ;container id
canvas_id.i ;canvas id
vert_id.i ;v scroller id
horz_id.i ;h scroller id
x.i ;gadget x
y.i ;gadget y
w.i ;gadget width
h.i ;gadget height
vc.i ;canvas of view
;
callback.i ; user callback
vw.i ; virtual width
vh.i ; virtual height
EndStructure
Procedure.i ViewGadgetCallback()
evtype=EventType()
gadget=EventGadget()
If IsGadget(gadget)
*VV.VView=GetGadgetData(gadget)
out.s=""
Select gadget
Case *VV\id
*VV\x=GadgetX(*VV\id)
*VV\y=GadgetY(*VV\id)
*VV\w=GadgetWidth(*VV\id)
*VV\h=GadgetHeight(*VV\id)
out+Str(*VV\x)+" "+Str(*VV\y)+" "+Str(*VV\w)+" "+Str(*VV\h)
StartDrawing(CanvasOutput(*VV\canvas_id))
DrawText(10,10,out)
StopDrawing()
ResizeGadget(*VV\horz_id,0,*VV\h-15,*VV\w-15,15)
ResizeGadget(*VV\vert_id,*VV\w-15,0,15,*VV\h)
ResizeGadget(*VV\canvas_id,0,0,*VV\w-15,*VV\h-15)
EndSelect
EndIf
EndProcedure
Procedure ViewGadget(id,x,y,width,height,virtual_width,virtual_height,callback)
*VV.VView=AllocateMemory(SizeOf(VView))
If id=#PB_Any
*VV\id=ContainerGadget(id,x,y,width,height)
result=*VV\id
Else
ContainerGadget(id,x,y,width,height)
*VV\id=id : result=GadgetID(id)
EndIf
If virtual_width=<width:virtual_width=width:EndIf
If virtual_height=<height:virtual_height=height:EndIf
*VV\canvas_id=CanvasGadget(#PB_Any,0,0,width,height)
SetGadgetData(*VV\canvas_id,*VV)
*VV\horz_id=ScrollBarGadget(#PB_Any,0,height-15,width-15,15,0,virtual_width,width)
SetGadgetData(*VV\horz_id,*VV)
*VV\vert_id=ScrollBarGadget(#PB_Any,width-15,0,15,height,0,virtual_height,height,#PB_ScrollBar_Vertical)
SetGadgetData(*VV\vert_id,*VV)
If virtual_width=<width : HideGadget(*VV\horz_id,#True) : EndIf
If virtual_height=<height : HideGadget(*VV\vert_id,#True) : EndIf
CloseGadgetList()
SetGadgetData(*VV\id,*VV)
BindGadgetEvent(*VV\id,@ViewGadgetCallback(),#PB_EventType_Resize)
ProcedureReturn result
EndProcedure
; test code
OpenWindow(0,0,0,600,400,"")
gad=ViewGadget(#PB_Any,0,0,390,390,500,500,0)
ButtonGadget(10,500,5,100,30,"Test")
SplitterGadget(20,0,0,400,390,gad,10)
Repeat
event=WaitWindowEvent()
If event=#PB_Event_Gadget
If EventGadget()=10
ResizeGadget(20,0,0,500,400)
EndIf
EndIf
Until event=#PB_Event_CloseWindow
BR
Erlend