andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

Using groups in OSX seems to add the top of the window until resize #359

Open draxil opened 5 years ago

draxil commented 5 years ago

If I use groups it looks fine in linux but in OSX a bunch of padding gets added to the top of the window. Looks to be the height of the combined children. As soon as the window is resized this magically fixes itself.

Rough demo program:

package main

import (
        "github.com/andlabs/ui"
)

func main(){
    ui.Main(func(){
        window := ui.NewWindow("boo", 100, 30, false)
        vbox := ui.NewVerticalBox()
        vbox.SetPadded(true)

        for i := 0; i < 10; i ++ {
           grp := ui.NewGroup("Group")
           grp.SetChild(ui.NewButton("THING"))
           vbox.Append(grp,true)
        }
        window.SetChild(vbox)
        window.Show()
    })
}
andlabs commented 5 years ago

Yes, this is a bug, and I'm not sure why this happens.

draxil commented 5 years ago

Is there any way to force a window resize so I can cheat this away?