SetMenu replaces the dock right-click menu. Pass nil to clear.
(items []DockMenuItem)
| 74 | |
| 75 | // SetMenu replaces the dock right-click menu. Pass nil to clear. |
| 76 | func (d *Dock) SetMenu(items []DockMenuItem) { |
| 77 | d.mu.Lock() |
| 78 | defer d.mu.Unlock() |
| 79 | // Defensive copy so later caller mutations do not affect us. |
| 80 | cpy := make([]DockMenuItem, len(items)) |
| 81 | copy(cpy, items) |
| 82 | d.impl.SetMenu(cpy) |
| 83 | } |
| 84 | |
| 85 | // setImpl swaps the underlying platform impl. Exposed for tests in this |
| 86 | // package only; never exported. |