PureBasic Forum
http://forums.purebasic.com/english/

SplitterGadget + ContainerGadget
http://forums.purebasic.com/english/viewtopic.php?f=15&t=68595
Page 1 of 1

Author:  wombats [ Tue Jun 06, 2017 12:10 pm ]
Post subject:  SplitterGadget + ContainerGadget

In my application, I have several SplitterGadgets with ContainerGadgets inside them. There seems to be an issue on Linux, however.

Code:
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?

Author:  Oma [ Mon Nov 06, 2017 7:44 pm ]
Post subject:  Re: SplitterGadget + ContainerGadget

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

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