Closed f-carraro closed 5 years ago
https://khchen.github.io/wNim/wFrame.html
If a frame has exactly one child window, not counting the status and toolbar, this child is resized to take the entire frame client area. If two or more windows are present, they should be laid out explicitly by manually
Try this:
import wNim
let app = App()
let frame = Frame(title="Test", size=(800, 600))
let panel1 = Panel(frame)
let panel2 = Panel(frame)
panel2.backgroundColor = wWheat
let b1 = StaticBox(panel1, label="Test")
proc layout()=
frame.autolayout """
H:|[panel1][panel2(panel1)]|
V:|[panel1..2]|
"""
panel1.autolayout """
spacing: 30
HV:|-[b1]-|
"""
frame.wEvent_Size do ():
layout()
layout()
frame.center()
frame.show()
app.mainLoop()
Thank you!
Consider the code:
Compiling this code creates a panel that is resized automatically when the window changes size. I don't understand why creating a second unused panel (uncommenting line 6) makes panel1 to become fixed when resizing the window.