Skip to content

ProgressBar example #1741

Closed Answered by philippe06150
Wanpaku asked this question in Q&A
May 18, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, not sure to understand what u mean by "... to set start or end ...", here is an working example, you just adjust value with "set-fraction", I just put a closure to change the value every second to have the ProgressBar living

use gtk::{glib, prelude::*};

fn main() -> glib::ExitCode {
    let application = gtk::Application::builder()
        .application_id("com.github.gtk-rs.examples.progressbar")
        .build();
    application.connect_activate(build_ui);
    application.run()
}

fn build_ui(application: &gtk::Application) {
    let window = gtk::ApplicationWindow::new(application);
    // set a progressbar, see reference in
    // https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Wanpaku
Comment options

@philippe06150
Comment options

Answer selected by Wanpaku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants