lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.78k stars 885 forks source link

Can I set widget or container's width to match_parent #741

Closed huhuang03 closed 3 years ago

huhuang03 commented 3 years ago

After I dynamic add a TabLayout to TabWidget like this:

newPage, _ := walk.NewTabPage()
newPage.SetLayout(walk.NewVBoxLayout())
label, _ := walk.NewLabel(newPage)
label.SetText("T1")
tabs.Pages().Add(newPage)

But the TabLayout become very small, and so the TabWidget.

My question is: Can I set widget or container's width to as much as possible like HSpacer VSpacer. Thank you.

lxn commented 3 years ago

Please try SetMinMaxSize.

huhuang03 commented 3 years ago

It's my fault. In my situation the real issue is that I forget to set Layout to a container..