container.go 680 B

1234567891011121314151617181920
  1. // Package container provides containers that are used to lay out and organise applications.
  2. package container
  3. import (
  4. "fyne.io/fyne/v2"
  5. )
  6. // New returns a new Container instance holding the specified CanvasObjects which will be laid out according to the specified Layout.
  7. //
  8. // Since: 2.0
  9. func New(layout fyne.Layout, objects ...fyne.CanvasObject) *fyne.Container {
  10. return &fyne.Container{Layout: layout, Objects: objects}
  11. }
  12. // NewWithoutLayout returns a new Container instance holding the specified CanvasObjects that are manually arranged.
  13. //
  14. // Since: 2.0
  15. func NewWithoutLayout(objects ...fyne.CanvasObject) *fyne.Container {
  16. return &fyne.Container{Objects: objects}
  17. }