Guide API
Skip to main content

Module command

Module command 

Source
Expand description

Commands and command sets.

A Command is the identity of an action — the thing a menu item, button, or key binding emits and a view interprets. Each command is an opaque newtype around a namespaced static string ("tv.ok"), so application- and view-defined commands are collision-safe by construction. A CommandSet is a set of commands the framework enables or disables in bulk.

The associated constants below are only the framework’s shared vocabulary — commands the core (program/view/window/dialog/menu/ status-line/desktop) generates or interprets generically, all under the tv. namespace. View-specific commands live with their view module (e.g. the editor’s char_left, the file dialog’s file_open); external views and apps mint their own the same way, via Command::custom with their own dotted prefix.

Guide: Commands & events.

§Turbo Vision heritage

Ports the cm* command family and TCommandSet (views.h, tcmdset.cpp). Commands were originally hand-assigned ints; here a command’s identity is a namespaced &'static str instead, so the command space is open and extensions cannot collide (deviation D1). The integers existed only for serialization (dropped) and to index a 256-bit set (now a HashSet), so commands no longer carry a number.

Structs§

Command
The identity of an action — what a menu item, button, or key binding emits and a view interprets. A command’s identity is a namespaced static string rather than a number, so downstream code can mint application-specific commands collision-safely.
CommandSet
A set of commands the framework enables or disables in bulk.