Button width different

Mac OSX specific forum
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Button width different

Post by Danilo »

Buttons with height 25 are different in width than buttons created using a height other than 25.

All buttons are created with width 200:

Code: Select all

If OpenWindow(0, 0, 0, 222, 400, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)
    For i = 0 To 9 Step 2
        ButtonGadget(i,   10, 10+ i   *30, 200, 25, "Standard Button "+i)
        ButtonGadget(i+1, 10, 10+(i+1)*30, 200, 24, "Standard Button "+Str(i+1))
    Next
    HideWindow(0,#False)
    ;SetActiveGadget(-1)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
User avatar
mk-soft
Always Here
Always Here
Posts: 5387
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Button width different

Post by mk-soft »

No pb bug

macOS calculation error for inner rounded rectangle. Button height 25 is a bad value.

Code: Select all

NSBackColor = CocoaMessage(0, 0, "NSColor systemOrangeColor")

If OpenWindow(0, 0, 0, 222, 400, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)
    For i = 0 To 10
      ButtonGadget(i,   10, 10 + i * 35, 200, 30 - i, "Standard Button " + Str(30 - i))
      CocoaMessage(0, GadgetID(i), "setBackgroundColor:", NSBackColor)
    Next
    HideWindow(0,#False)
    ;SetActiveGadget(-1)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
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
Post Reply