Documentation
¶
Index ¶
- Variables
- func NewAdaptativeGrid(size int, widgets ...gtk.Widgetter) *gtk.Grid
- func NewCHbox(spacing int, widgets ...gtk.Widgetter) *gtk.Box
- func NewCVbox(spacing int, widgets ...gtk.Widgetter) *gtk.Box
- func NewFrame(label string, child gtk.Widgetter) *gtk.Frame
- func NewHPaned(left, right gtk.Widgetter) *gtk.Paned
- func NewHbox(widgets ...gtk.Widgetter) *gtk.Box
- func NewNoteBook(tabs ...*NotebookTab) *gtk.Notebook
- func NewVPaned(top, bottom gtk.Widgetter) *gtk.Paned
- func NewVbox(widgets ...gtk.Widgetter) *gtk.Box
- type NotebookTab
- type ScrolledBox
- func NewScrolled(child *gtk.Box) *ScrolledBox
- func NewScrolledCHbox(spacing int, widgets ...gtk.Widgetter) *ScrolledBox
- func NewScrolledCVbox(spacing int, widgets ...gtk.Widgetter) *ScrolledBox
- func NewScrolledHbox(widgets ...gtk.Widgetter) *ScrolledBox
- func NewScrolledVbox(widgets ...gtk.Widgetter) *ScrolledBox
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSpacing = 4
Functions ¶
func NewAdaptativeGrid ¶
Creates a grid that adapts to the specified size, items are fixed, they have to be added manually to the grid if you want to append them.
func NewCHbox ¶ added in v1.4.0
// It is exactly the same as NewHbox but in this case you specify the spacing when creating the widget.
func NewCVbox ¶ added in v1.4.0
It is exactly the same as NewVbox but in this case you specify the spacing when creating the widget.
func NewNoteBook ¶
func NewNoteBook(tabs ...*NotebookTab) *gtk.Notebook
Create a new notebook with the specified NotebookTabs.
Example ¶
package main
import (
"github.com/Tom5521/gtk4tools/pkg/boxes"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
)
func main() {
w := gtk.NewWindow()
notebook := boxes.NewNoteBook(
&boxes.NotebookTab{
Child: boxes.NewVbox(
gtk.NewLabel("Hello World"),
),
Label: gtk.NewLabel("Tab1"),
},
&boxes.NotebookTab{
Child: boxes.NewVbox(
gtk.NewLabel("Hello World in tab 2"),
),
Label: gtk.NewLabel("Tab2"),
},
)
w.SetChild(notebook)
w.Present()
}
Output:
Types ¶
type ScrolledBox ¶
type ScrolledBox struct {
*gtk.ScrolledWindow
Orientation gtk.Orientation
Spacing int
Child *gtk.Box
}
func NewScrolled ¶
func NewScrolled(child *gtk.Box) *ScrolledBox
func NewScrolledCHbox ¶ added in v1.4.1
func NewScrolledCHbox(spacing int, widgets ...gtk.Widgetter) *ScrolledBox
func NewScrolledCVbox ¶ added in v1.4.1
func NewScrolledCVbox(spacing int, widgets ...gtk.Widgetter) *ScrolledBox
func NewScrolledHbox ¶
func NewScrolledHbox(widgets ...gtk.Widgetter) *ScrolledBox
Creates a horizontal box that is scrollable in the X and Y axes, the orientation is that of the child.
func NewScrolledVbox ¶
func NewScrolledVbox(widgets ...gtk.Widgetter) *ScrolledBox
Creates a vertical box that is scrollable in the X and Y axes, the orientation is that of the child.
func (*ScrolledBox) SetChild ¶
func (s *ScrolledBox) SetChild(child *gtk.Box)
func (*ScrolledBox) SetOrientation ¶
func (s *ScrolledBox) SetOrientation(orientation gtk.Orientation)
Set the orientation of the child.
func (*ScrolledBox) SetSpacing ¶ added in v1.5.0
func (s *ScrolledBox) SetSpacing(spacing int)
Click to show internal directories.
Click to hide internal directories.