wNim
wNim copied to clipboard
Can't place more than 6 buttons
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.