Documentation
¶
Overview ¶
Package cmd implements vigo's command bus: a CommandSet for grouping command IDs, an Enabler that tracks which commands are currently active, and a key-binding table that maps KeyEvents to commands.
Views consult cmd.IsEnabled to decide their dim state; bindings resolve framework keys (F1 = CmdHelp) and host-defined ones (Ctrl-S = save). Hosts toggle commands via Enable/Disable; the Enabler notifies subscribers so menus can repaint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bindings ¶
Bindings maps a KeyEvent to a command ID. The map key compares all three KeyEvent fields (Key, Mod, Rune) so Alt-X and a bare X do not collide.
type Enabler ¶
type Enabler struct {
// contains filtered or unexported fields
}
Enabler tracks which commands are enabled. It also keeps a list of subscribers that get notified when the enabled set changes; the menu uses that signal to dim or undim items without polling.
func NewEnabler ¶
NewEnabler returns an Enabler with the given initial set enabled. Pass nil for an empty starting set.
func (*Enabler) Disable ¶
Disable turns each id in s off. Subscribers are notified once after the bulk update if any state actually changed.
func (*Enabler) Enable ¶
Enable turns each id in s on. Subscribers are notified once after the bulk update if any state actually changed.
Directories
¶
| Path | Synopsis |
|---|---|
|
Command vigo launches the Vigo terminal IDE.
|
Command vigo launches the Vigo terminal IDE. |
|
Command vigo-demos boots the vigo desktop with the four classic Turbo Vision sample tools (Calculator, Calendar, ASCIITable, Puzzle) reachable from the menu bar.
|
Command vigo-demos boots the vigo desktop with the four classic Turbo Vision sample tools (Calculator, Calendar, ASCIITable, Puzzle) reachable from the menu bar. |