Type Definition libnotcurses_sys::widgets::NcProgBar [−][src]
type NcProgBar = ncprogbar;
Expand description
Progress bars. They proceed linearly in any of four directions.
The entirety of the plane will be used – any border should be provided by the caller on another plane.
The plane will not be erased; text preloaded into the plane will be consumed by the progress indicator.
The bar is redrawn for each provided progress report (a double between 0 and 1), and can regress with lower values.
The procession will take place along the longer dimension at the time of each redraw, with the horizontal length scaled by 2 for purposes of comparison. I.e. for a plane of 20 rows and 50 columns, the progress will be to the right (50 > 40), or left with NCPROGBAR_OPTION_RETROGRADE.
type in C: ncprogbar (struct)
Implementations
New NcProgBar.
Takes ownership of the plane
, which will be destroyed by
destroy(). The progress bar is initially at 0%.
New NcProgBar. Expects an NcProgBarOptions struct.
C style function: ncprogbar_create().
Destroy the progress bar and its underlying ncplane.
C style function: ncprogbar_destroy().
Return a reference to the ncprogbar’s underlying ncplane.
C style function: ncprogbar_plane().
Get the progress bar’s completion, an f64 on [0, 1].
C style function: ncprogbar_progress().
Sets the progress bar’s completion, an 0 <= f64 <= 1.
Returns NCRESULT_ERR if progress is < 0 || > 1.
C style function: ncprogbar_set_progress().