wNim icon indicating copy to clipboard operation
wNim copied to clipboard

Can't place more than 6 buttons

Open sonicsmooth opened this issue 11 months ago • 0 comments

When I try adding more than 5 or 6 buttons in a vertical column, only the most recent six buttons are shown. I have tried this with a stack: type of syntax too. Same result when I don't use VFL and just use the normal wNim layout DSL.

    import wNim/[wApp, wMacros, wFrame, wPanel, wEvent, wButton]

    wClass(wButtonPanel of wPanel):
    proc init(self: wButtonPanel, parent: wWindow) =
        wPanel(self).init(parent)
        var b1 = Button(self, label="Randomize")
        var b2 = Button(self, label="Compact X←")
        var b3 = Button(self, label="Compact X→")
        var b4 = Button(self, label="Compact Y↑")
        var b5 = Button(self, label="Compact Y↓")
        var b6 = Button(self, label="Compact X← then Y↑")
        var b7 = Button(self, label="Compact X← then Y↓")

        proc layout(self: wButtonPanel) =
        self.autolayout  """
            V:|-[b1][b2][b3][b4][b5][b6][b7]
            H:[b1..7(120)]
            """
        self.layout()
        self.wEvent_Size do():
        self.layout()

    let app = App(wSystemDpiAware)
    let frame = Frame(title="Button Frame", size=(600,400))
    let bp = ButtonPanel(frame)
    discard bp

    frame.center()
    frame.show()
    app.mainLoop()

This should show 7 buttons but it only shows 5. image

sonicsmooth avatar Jan 06 '25 20:01 sonicsmooth