primitives

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionPopover

func ActionPopover(p *gtk.Popover, actions [][2]string)

func AddClass

func AddClass(styleCtx StyleContexter, classes ...string)

func AppendMenuItems

func AppendMenuItems(menu interface{ Append(gtk.IMenuItem) }, items []gtk.IMenuItem)

func AttachCSS

func AttachCSS(ctx StyleContexter, prov *gtk.CssProvider)

func BinLeftAlignLabel

func BinLeftAlignLabel(bin Bin)

func BindDynamicMenu

func BindDynamicMenu(connector Connector, constr func(menu *gtk.Menu))

func BindMenu

func BindMenu(connector Connector, menu *gtk.Menu)

func ChildrenLen

func ChildrenLen(w Container) int

ChildrenLen gets the total count of children for the given container.

func DestroyChildren

func DestroyChildren(w Container)

DestroyChildren destroys all children of the given container, removing and freeing them at the same time.

func EachChildren

func EachChildren(w Container, fn func(i int, v interface{}) bool)

func ForeachChild

func ForeachChild(w Container, fn func(interface{}) (stop bool))

ForeachChildBackwards iterates the list. If the callback returns true, then the loop is broken.

func ForeachChildBackwards

func ForeachChildBackwards(w Container, fn func(interface{}) (stop bool))

ForeachChildBackwards iterates the list backwards. If the callback returns true, then the loop is broken.

func GetName

func GetName(namer Namer) string

func HiddenDisabledMenuItem

func HiddenDisabledMenuItem(label string, fn interface{}) *gtk.MenuItem

func HiddenMenuItem

func HiddenMenuItem(label string, fn interface{}) *gtk.MenuItem

func InlineCSS

func InlineCSS(ctx StyleContexter, css string)

func LeafletOnFold

func LeafletOnFold(leaflet *handy.Leaflet, foldedFn func(folded bool))

LeafletOnFold binds a callback to a leaflet that would be called when the leaflet's folded state changes.

func MenuItem(label string, fn interface{}) *gtk.MenuItem

func NewActionButton

func NewActionButton(iconName string, actions [][2]string) *gtk.MenuButton

NewActionButton creates a new menu button that spawns a popover with the listed actions.

func NewButtonIcon

func NewButtonIcon(icon string) *gtk.Image

func NewImageIconPx

func NewImageIconPx(icon string, sizepx int) *gtk.Image

func NewMenuActionButton

func NewMenuActionButton(actions [][2]string) *gtk.MenuButton

NewMenuActionButton is the same as NewActionButton, but it uses the open-menu-symbolic icon.

func NthChild

func NthChild(w Container, n int) interface{}

func OnRightClick

func OnRightClick(connector Connector, fn func())

func PrepareCSS

func PrepareCSS(css string) *gtk.CssProvider

func PrepareClassCSS

func PrepareClassCSS(class, css string) (attach func(StyleContexter))

func PrependMenuItems

func PrependMenuItems(menu interface{ Prepend(gtk.IMenuItem) }, items []gtk.IMenuItem)

func RemoveChildren

func RemoveChildren(w Container)

RemoveChildren removes all children from the given container. Most of the time, DestroyChildren should be preferred if no children will be reused.

func RemoveClass

func RemoveClass(styleCtx StyleContexter, classes ...string)

func SetImageIcon

func SetImageIcon(img ImageIconSetter, icon string, sizepx int)

func SuggestAction

func SuggestAction(styleCtx StyleContextFocuser)

SuggestAction styles the element to have the suggeested action class.

Types

type Bin

type Bin interface {
	GetChild() (gtk.IWidget, error)
}

type ClassEnum

type ClassEnum struct {
	// contains filtered or unexported fields
}

func (*ClassEnum) SetClass

func (c *ClassEnum) SetClass(ctx StyleContexter, class string)

type Connector

type Connector interface {
	Connect(string, interface{}) glib.SignalHandle
	ConnectAfter(string, interface{}) glib.SignalHandle
	HandlerDisconnect(glib.SignalHandle)
}

type Container

type Container interface {
	Remove(gtk.IWidget)
	GetChildren() *glib.List
}

type ImageIconSetter

type ImageIconSetter interface {
	SetFromIconName(string, gtk.IconSize)
	SetPixelSize(int)
}

type LabelTweaker

type LabelTweaker interface {
	SetUseMarkup(bool)
	SetHAlign(gtk.Align)
	SetXAlign(float64)
}

LabelTweaker is used for ActionPopover and other functions that may need to change the alignment of children widgets.

type Namer

type Namer interface {
	SetName(string)
	GetName() (string, error)
}

type StyleContextFocuser

type StyleContextFocuser interface {
	StyleContexter
	GrabFocus()
}

type StyleContexter

type StyleContexter interface {
	GetStyleContext() (*gtk.StyleContext, error)
}

type WidgetDestroyer

type WidgetDestroyer interface {
	gtk.IWidget
	Destroy()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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