MCPcopy Create free account
hub / github.com/cogentcore/core / SetKey

Method SetKey

core/button.go:284–287  ·  view source on GitHub ↗

SetKey sets the shortcut of the button from the given [keymap.Functions].

(kf keymap.Functions)

Source from the content-addressed store, hash-verified

282
283// SetKey sets the shortcut of the button from the given [keymap.Functions].
284func (bt *Button) SetKey(kf keymap.Functions) *Button {
285 bt.SetShortcut(kf.Chord())
286 return bt
287}
288
289// Label returns the text of the button if it is set; otherwise it returns the name.
290func (bt *Button) Label() string {

Callers 10

contextMenuMethod · 0.80
contextMenuReadOnlyMethod · 0.80
contextMenuMethod · 0.80
MakeToolbarMethod · 0.80
contextMenuMethod · 0.80
makeStandardAppBarFunction · 0.80
standardOverflowMenuMethod · 0.80
TestButtonShortcutKeyFunction · 0.80
MakeToolbarMethod · 0.80
contextMenuMethod · 0.80

Calls 2

SetShortcutMethod · 0.95
ChordMethod · 0.80

Tested by 1

TestButtonShortcutKeyFunction · 0.64