PB v6.xx - Wrong StatusBar Position with use ToolBar

Post bugreports for the Mac OSX version here
User avatar
mk-soft
Always Here
Always Here
Posts: 6224
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

PB v6.xx - Wrong StatusBar Position with use ToolBar

Post by mk-soft »

When using StatusBar and ToolBar, the StatusBar is set to the wrong position during window creation.
After large change from the window, this is correct again.
Probably still have to adjust the calculation to the new macOS standard size from the ToolBar (24x24 pixels)

Code: Select all

;-TOP

Procedure UpdateWindow()
  Protected dx, dy
  dx = WindowWidth(0)
  dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
  ; Resize Gadgets
EndProcedure

Procedure Main()
  Protected dx, dy
  
  #WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
  
  If OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "Test Window", #WinStyle)
    
    ; MenuBar
    CreateMenu(0, WindowID(0))
    MenuTitle("&File")
    MenuItem(99, "E&xit")
    
    ; StatusBar
    CreateStatusBar(0, WindowID(0))
    AddStatusBarField(#PB_Ignore)
    StatusBarText(0, 0, " Label")
    
    ; ToolBar
    CreateImage(0, 22, 22, 32, #Red)
    CreateToolBar(0, WindowID(0))
    ToolBarImageButton(0, ImageID(0))
    
    ; Gadgets
    dx = WindowWidth(0)
    dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
    
    ; Bind Events
    BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
    
    ; Main Loop
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Select EventWindow()
            Case 0
              Break
          EndSelect
          
        Case #PB_Event_Menu
          Select EventMenu()
            Case 99, #PB_Menu_Quit
              PostEvent(#PB_Event_CloseWindow, 0, 0)
              
          EndSelect
          
        Case #PB_Event_Gadget
          Select EventGadget()
              
          EndSelect
          
      EndSelect
    ForEver
    
  EndIf
  
EndProcedure : Main()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kiffi
Addict
Addict
Posts: 1491
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: PB v6.xx - Wrong StatusBar Position with use ToolBar

Post by Kiffi »

Confirmed (Mac Mini M4, Sequoia)

Ugly workaround until the bug is fixed:

Code: Select all

    ; Bind Events
    [...]
    
    ResizeWindow(0, #PB_Ignore, #PB_Ignore, WindowWidth(0) + 1, WindowHeight(0) + 1)
    
    ; Main Loop
    [...]
Hygge
Post Reply