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

Method overflowMenu

core/toolbar.go:177–193  ·  view source on GitHub ↗

overflowMenu adds the overflow menu to the given Scene.

(m *Scene)

Source from the content-addressed store, hash-verified

175
176// overflowMenu adds the overflow menu to the given Scene.
177func (tb *Toolbar) overflowMenu(m *Scene) {
178 nm := len(tb.OverflowMenus)
179 ni := len(tb.overflowItems)
180 if ni > 0 {
181 p := &tree.Plan{Parent: tb.This}
182 p.Children = tb.overflowItems
183 p.Update(m)
184 if nm > 1 { // default includes sep
185 NewSeparator(m)
186 }
187 }
188 // reverse order so defaults are last
189 for i := nm - 1; i >= 0; i-- {
190 fn := tb.OverflowMenus[i]
191 fn(m)
192 }
193}
194
195// AddOverflowMenu adds the given menu function to the overflow menu list.
196// These functions are called in reverse order such that the last added function

Callers

nothing calls this directly

Calls 2

UpdateMethod · 0.95
NewSeparatorFunction · 0.85

Tested by

no test coverage detected