Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomLayout ¶
type CustomLayout struct {
// contains filtered or unexported fields
}
CustomLayout is a custom layout manager.
Example ¶
layout := layout.New(layout.Funcs{ RequestMode: func(w2 gtk.Widgetter) gtk.SizeRequestMode { return gtk.SizeRequestConstantSize }, Measure: func(w2 gtk.Widgetter, orientation gtk.Orientation, forSize int) ( minimum int, natural int, minimumBaseline int, naturalBaseline int, ) { w := gtk.BaseWidget(w2) minimum, natural, minimumBaseline, naturalBaseline = w.Measure(orientation, forSize) if minimum < 100 { minimum = 100 } return minimum, natural, minimumBaseline, naturalBaseline }, Allocate: func(w2 gtk.Widgetter, width int, height int, baseline int) { w := gtk.BaseWidget(w2) w.Allocate(width, height, baseline, nil) }, }) label := gtk.NewLabel("Hello, world!") layout.SetForWidget(label) w := gtk.NewWindow() w.SetChild(label) w.Show()
Output:
func (*CustomLayout) SetForWidget ¶
func (l *CustomLayout) SetForWidget(w gtk.Widgetter)
SetForWidget sets the layout manager for the given widget. It handles the initialization of the layout manager for the widget.
type Funcs ¶
type Funcs struct { RequestMode RequestModeFunc Measure MeasureFunc Allocate Allocate }
Funcs is a box of functions for the layout manager.
type MeasureFunc ¶
type MeasureFunc func(w gtk.Widgetter, orientation gtk.Orientation, forSize int) ( minimum int, natural int, minimumBaseline int, naturalBaseline int)
Measure is called to measure the size of the widget.
type RequestModeFunc ¶
type RequestModeFunc func(w gtk.Widgetter) gtk.SizeRequestMode
RequestModeFunc queries the widget for its preferred size request mode.
Click to show internal directories.
Click to hide internal directories.