Page 1 of 1

SplitterGadget + ContainerGadget

Posted: Tue Jun 06, 2017 12:10 pm
by wombats
In my application, I have several SplitterGadgets with ContainerGadgets inside them. There seems to be an issue on Linux, however.

Code: Select all

Enumeration
  #Window
  #Splitter
  #Container1
  #Container2
  #Button1
EndEnumeration

Procedure WindowResized()
  ResizeGadget(#Splitter, 0, 0, WindowWidth(#Window), WindowHeight(#Window))
EndProcedure

Procedure SplitterMoved()
  ResizeGadget(#Button1, 0, 0, GadgetWidth(#Container1), GadgetHeight(#Container1))
EndProcedure

If OpenWindow(#Window, 0, 0, 640, 480, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
  
  BindEvent(#PB_Event_SizeWindow, @WindowResized(), #Window)
  
  ContainerGadget(#Container1, 0, 0, 0, 0, #PB_Container_Single)
    ButtonGadget(#Button1, 0, 0, 0, 0, "One")
  CloseGadgetList()
  ContainerGadget(#Container2, 0, 0, 0, 0, #PB_Container_Single)
  CloseGadgetList()
  
  SplitterGadget(#Splitter, 0, 0, WindowWidth(#Window), WindowHeight(#Window), #Container1, #Container2, #PB_Splitter_Separator)

  BindEvent(#PB_Event_Gadget, @SplitterMoved(), #Window, #Splitter, #PB_All)
  
  PostEvent(#PB_Event_Gadget, @SplitterMoved(), #Window)
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
As the ButtonGadget gets bigger, it stops the SplitterGadget bar from moving upwards. Is this the normal behaviour on Linux? If so, how else could I have several gadgets on one side of a SplitterGadget?

Re: SplitterGadget + ContainerGadget

Posted: Mon Nov 06, 2017 7:44 pm
by Oma
Just reminded me of this problematic code on gtk3 and gave him a new test.
Now seems to work on PB5.46B1. :D

Regards, Charly