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
countorcortotal- Total number of steps/items to process (optional)valueorprogressorv- Current progress value (optional)textorcaption- Text to display on the progress bar (optional)pausedorpause- Whether the progress bar is paused (optional)flags- Control flags (optional). Can be:- HidePercentage - Hides the percentage display
- Position and size:
x,y- Position coordinateswidth/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"
);