[][src]Type Definition rubrail::BarId

type BarId = u64;

Reference to a horizontal bar created by a TTouchbar

A BarId is returned any time a bar is created, where a bar is a horizontal view that can have smaller UI elements added to it, and can eventually be displayed on the Touch Bar hardware.

The two types of bars are the root bar, which appears when you first open the Touch Bar by clicking on its icon in the Control Strip, and popover bars, which behave identically but are presented by clicking on buttons on a bar or popover. Popovers provide the mechanism for recursive menus.

Memory Allocation

Memory is allocated for a bar when it is created, and is not released until the bar is made the root bar, or a popover of the root bar, enabled, and subsequently replaced by another bar. That is, memory is deallocated recursively when an available Touch Bar menu is replaced. If a menu is never registered as the active menu, then it will never be deallocated. BarId does not implement the Drop trait, and does not deallocate any memory when it falls out of scope.