[][src]Trait rubrail::TScrubberData

pub trait TScrubberData {
    pub fn count(&self, item: ItemId) -> u32;
pub fn text(&self, item: ItemId, idx: u32) -> String;
pub fn width(&self, item: ItemId, idx: u32) -> u32;
pub fn touch(&self, item: ItemId, idx: u32); }

The callback API for managing data in a Scrubber

The Touch Bar supports a UI element called a 'scrubber', which is a horizontally scrolling widget filled with items which can be dynamically changed, and selected. This is the primary interface for choosing from a list of (possibly dynamic) options.

Since the contents of a scrubber are dynamic, the scrubber fills in its data on request through a series of callbacks. A type that implements TScrubberData provides all of the callbacks that a scrubber needs to present its options.

See the examples for usage.

Required methods

pub fn count(&self, item: ItemId) -> u32[src]

Returns the number of items in the scrubber

Arguments

  • item - The ItemId of the interacting scrubber

pub fn text(&self, item: ItemId, idx: u32) -> String[src]

Returns the text of the given index in the scrubber

Arguments

  • item - The ItemId of the interacting scrubber
  • idx - The index of the relevant item in the scrubber

pub fn width(&self, item: ItemId, idx: u32) -> u32[src]

Returns the width (in pixels) of the given index in the scrubber

Arguments

  • item - The ItemId of the interacting scrubber
  • idx - The index of the relevant item in the scrubber

pub fn touch(&self, item: ItemId, idx: u32)[src]

Called when the given index in the scrubber is selected

Arguments

  • item - The ItemId of the interacting scrubber
  • idx - The index of the relevant item in the scrubber
Loading content...

Implementors

Loading content...