Search code examples
gofyne

Go Fyne Disable HSplit Resize?


How do I disable or prevent the split pane to be resizable?

hSplit := container.NewHSplit(
    hello,
    widget.NewButton("Hi!", func() {
        hello.SetText("Welcome :)")
    }),
)

enter image description here

I am trying to have a label followed by the NewList widget. However, I have tried a bunch of layouts for this e.g NewVBoxLayout but as per the doc, all elements in this will be set to the min height. Hence the list becomes extremely small. I am unable to do this using container.

I have tried NewMaxLayout as well, but the list now overlaps with the Select Item label


Solution

  • Usually when you want 1 item to fill space and others to arrange around it you’d use Border. Note that containers inside containers with different layouts is the way we build more complex arrangements such as you illustrate above.