Skip to main content

progressbar

Macro progressbar 

Source
progressbar!() { /* proc-macro */ }
Expand description

Creates a new progress bar control for displaying progress of an operation. The format is progressbar!("attributes") where the attributes are pairs of key-value, separated by comma.

§Parameters

  • count or c or total - Total number of steps/items to process (optional)
  • value or progress or v - Current progress value (optional)
  • text or caption - Text to display on the progress bar (optional)
  • paused or pause - Whether the progress bar is paused (optional)
  • flags - Control flags (optional). Can be:
    • HidePercentage - Hides the percentage display
  • Position and size:
    • x, y - Position coordinates
    • width/w, height/h - Control dimensions
  • Layout:
    • align/a - Alignment: Left, Right, Top, Bottom, Center, etc.
    • dock/d - Docking: Left, Right, Top, Bottom, Center, etc.
  • Margins: left/l, right/r, top/t, bottom/b
  • State: enabled, visible

§Examples

use appcui::prelude::*;
 
// Basic progress bar
let pb = progressbar!("x=1, y=1, width=40");
 
// Progress bar with total count and current value
let pb = progressbar!(
    "count: 100,
    value: 42,
    text: 'Processing...',
    x=2, y=2, width=50"
);
 
// Paused progress bar without percentage
let pb = progressbar!(
    "count: 50,
    value: 25,
    paused: true,
    flags: HidePercentage,
    x=3, y=3, width=30"
);