boxes

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var DefaultSpacing = 4

Functions

func NewAdaptativeGrid

func NewAdaptativeGrid(size int, widgets ...gtk.Widgetter) *gtk.Grid

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

func NewCHbox(spacing int, widgets ...gtk.Widgetter) *gtk.Box

// 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

func NewCVbox(spacing int, widgets ...gtk.Widgetter) *gtk.Box

It is exactly the same as NewVbox but in this case you specify the spacing when creating the widget.

func NewFrame

func NewFrame(label string, child gtk.Widgetter) *gtk.Frame

Creates a new *gtk.Frame.

func NewHPaned

func NewHPaned(left, right gtk.Widgetter) *gtk.Paned

Creates a *gtk.Paned with horizontal orientation.

func NewHbox

func NewHbox(widgets ...gtk.Widgetter) *gtk.Box

Creates a new *gtk.Box with horizontal orientation.

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()
}

func NewVPaned

func NewVPaned(top, bottom gtk.Widgetter) *gtk.Paned

Creates a *gtk.Paned with vertical orientation.

func NewVbox

func NewVbox(widgets ...gtk.Widgetter) *gtk.Box

Creates a new *gtk.Box with vertical orientation.

Types

type NotebookTab

type NotebookTab struct {
	Label gtk.Widgetter
	Child gtk.Widgetter
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL