MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / NewFormButton

Function NewFormButton

internal/ui/components/form_button.go:39–50  ·  view source on GitHub ↗

NewFormButton creates a new FormButton with the given label and callback.

(label string, selected func())

Source from the content-addressed store, hash-verified

37
38// NewFormButton creates a new FormButton with the given label and callback.
39func NewFormButton(label string, selected func()) *FormButton {
40 button := tview.NewButton(label)
41 button.SetSelectedFunc(selected)
42
43 return &FormButton{
44 Box: tview.NewBox(),
45 button: button,
46 label: label,
47 selected: selected,
48 alignment: AlignCenter, // Default to centered
49 }
50}
51
52// SetAlignment sets the button's alignment within its container.
53func (b *FormButton) SetAlignment(alignment ButtonAlignment) *FormButton {

Callers 1

NewVMConfigPageFunction · 0.85

Calls 1

SetSelectedFuncMethod · 0.80

Tested by

no test coverage detected