Fyne API "container"

container


import "fyne.io/fyne/v2/container"

Package container provides containers that are used to lay out and organise applications.

Usage

const (
	// ScrollBoth supports horizontal and vertical scrolling.
	ScrollBoth ScrollDirection = widget.ScrollBoth
	// ScrollHorizontalOnly specifies the scrolling should only happen left to right.
	ScrollHorizontalOnly = widget.ScrollHorizontalOnly
	// ScrollVerticalOnly specifies the scrolling should only happen top to bottom.
	ScrollVerticalOnly = widget.ScrollVerticalOnly
	// ScrollNone turns off scrolling for this container.
	//
	// Since: 2.1
	ScrollNone = widget.ScrollNone
)

Constants for valid values of ScrollDirection.

func New

func New(layout fyne.Layout, objects ...fyne.CanvasObject) *fyne.Container

New returns a new Container instance holding the specified CanvasObjects which will be laid out according to the specified Layout.

Since: 2.0

func NewAdaptiveGrid

func NewAdaptiveGrid(rowcols int, objects ...fyne.CanvasObject) *fyne.Container

NewAdaptiveGrid creates a new container with the specified objects and using the grid layout. When in a horizontal arrangement the rowcols parameter will specify the column count, when in vertical it will specify the rows. On mobile this will dynamically refresh when device is rotated.

Since: 1.4

func NewBorder

func NewBorder(top, bottom, left, right fyne.CanvasObject, objects ...fyne.CanvasObject) *fyne.Container

NewBorder creates a new container with the specified objects and using the border layout. The top, bottom, left and right parameters specify the items that should be placed around edges, the remaining elements will be in the center. Nil can be used to an edge if it should not be filled.

Since: 1.4

func NewCenter

func NewCenter(objects ...fyne.CanvasObject) *fyne.Container

NewCenter creates a new container with the specified objects centered in the available space.

Since: 1.4

func NewGridWithColumns

func NewGridWithColumns(cols int, objects ...fyne.CanvasObject) *fyne.Container

NewGridWithColumns creates a new container with the specified objects and using the grid layout with a specified number of columns. The number of rows will depend on how many children are in the container.

Since: 1.4

func NewGridWithRows

func NewGridWithRows(rows int, objects ...fyne.CanvasObject) *fyne.Container

NewGridWithRows creates a new container with the specified objects and using the grid layout with a specified number of rows. The number of columns will depend on how many children are in the container.

Since: 1.4

func NewGridWrap

func NewGridWrap(size fyne.Size, objects ...fyne.CanvasObject) *fyne.Container

NewGridWrap creates a new container with the specified objects and using the gridwrap layout. Every element will be resized to the size parameter and the content will arrange along a row and flow to a new row if the elements don’t fit.

Since: 1.4

func NewHBox

func NewHBox(objects ...fyne.CanvasObject) *fyne.Container

NewHBox creates a new container with the specified objects and using the HBox layout. The objects will be placed in the container from left to right.

Since: 1.4

func NewMax

func NewMax(objects ...fyne.CanvasObject) *fyne.Container

NewMax creates a new container with the specified objects filling the available space.

Since: 1.4

func NewPadded

func NewPadded(objects ...fyne.CanvasObject) *fyne.Container

NewPadded creates a new container with the specified objects inset by standard padding size.

Since: 1.4

func NewVBox

func NewVBox(objects ...fyne.CanvasObject) *fyne.Container

NewVBox creates a new container with the specified objects and using the VBox layout. The objects will be stacked in the container from top to bottom.

Since: 1.4

func NewWithoutLayout

func NewWithoutLayout(objects ...fyne.CanvasObject) *fyne.Container

NewWithoutLayout returns a new Container instance holding the specified CanvasObjects that are manually arranged.

Since: 2.0

types