SplitterGadget + ContainerGadget

Linux specific forum
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

SplitterGadget + ContainerGadget

Post 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?
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

Re: SplitterGadget + ContainerGadget

Post 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
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Post Reply