Page 1 of 1

vbox does not work in splittergadget under Linux

Posted: Tue Dec 16, 2025 6:15 am
by Cyllceaux
Hi,

This code works fine on Windows, but on Linux the vbox does not work. But only in a SplitterGadget. Outside the Splitter it workes fine.
Image

Code: Select all

#Dialog = 0
#Xml = 0

XML$ + 
"<window width='400' height='300' name='test' text='Test' flags='#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget'>" +
"<splitter name='splMain' flags='#PB_Splitter_Vertical|#PB_Splitter_Separator'>"+
"  <vbox expand='item:6'>"+
"              <button text='All' name='btnMainAll' />"+
"              <button text='Today' name='btnMainToday'/>"+
"              <hbox expand='item:1'>"+
"                <button text='Unread' name='btnMainUnread' />"+
"                <buttonimage height='24' width='24' name='btnReadAll' /> "+
"              </hbox>"+
"              <button text='Favorite' name='btnMainFavorite' />"+
"              <button text='Archive' name='btnMainArchive' />"+
"              <tree name='trMain' flags='#PB_Tree_AlwaysShowSelection|#PB_Tree_NoButtons|#PB_Tree_NoLines' /> "+
"            </vbox>" +
"<container/>"+
"</splitter>"+
"</window>"

If CatchXML(#Xml, @XML$, StringByteLength(XML$)) And XMLStatus(#Xml) = #PB_XML_Success 
  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  Else
    Debug "Dialog error: " + DialogError(#Dialog)
  EndIf
Else
  Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf

Re: vbox does not work in splittergadget under Linux

Posted: Tue Dec 16, 2025 9:42 pm
by Shardik
Cyllceaux wrote: This code works fine on Windows, but on Linux the vbox does not work. But only in a SplitterGadget. Outside the Splitter it workes fine.
Please always state your Windows and Linux version and on Linux the desktop environment and the display server protocol (Wayland or X11)!

I can confirm the missing refresh of the splitter contents on Linux Mint 21.3 'Virginia' x64 with Cinnamon (X11) and on Raspberry Pi OS ARM64 (X11). On MacOS 13.7.8 'Ventura' the problem doesn't occur.

As a workaround on Linux you may use the RefreshDialog() command. Change your event loop from

Code: Select all

    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
to

Code: Select all

    SplitterID = DialogGadget(#Dialog, "splMain")

    Repeat
      Event = WaitWindowEvent()

      If Event = #PB_Event_Gadget
        If EventGadget() = SplitterID
          RefreshDialog(#Dialog)
        EndIf
      EndIf
    Until Event = #PB_Event_CloseWindow
and the refresh of the SplitterGadget contents should work like a charm!