Giter VIP home page Giter VIP logo

Comments (4)

EPashkin avatar EPashkin commented on August 22, 2024

@jpercyasnet You not tried do something like https://stackoverflow.com/a/8383141/2604116 ?

from examples.

jpercyasnet avatar jpercyasnet commented on August 22, 2024

This is the rust code when button is clicked. addition code is added later to update the progress bar but even the first set does not update.

//----------------- list button start -----------------------------------

let directory_combobox_weak2 = directory_combobox.downgrade();
let messageval_label_weak2 = messageval_label.downgrade();
let from_entry_weak2 = from_entry.downgrade();
let to_entry_weak2 = to_entry.downgrade();
let iconsize_entry_weak2 = iconsize_entry.downgrade();
let icon_view_weak2 = icon_view.downgrade();
let progress_progressbar_weak2 = progress_progressbar.downgrade();



listgroup_button.connect_clicked(clone!(directory_combobox_weak2, messageval_label_weak2, from_entry_weak2, to_entry_weak2, iconsize_entry_weak2, progress_progressbar_weak2 => move|_| {
    let directory_combobox = upgrade_weak!(directory_combobox_weak2);
    let messageval_label = upgrade_weak!(messageval_label_weak2);
    let from_entry = upgrade_weak!(from_entry_weak2);
    let to_entry = upgrade_weak!(to_entry_weak2);
    let iconsize_entry = upgrade_weak!(iconsize_entry_weak2);
    let icon_view = upgrade_weak!(icon_view_weak2);
    let progress_progressbar = upgrade_weak!(progress_progressbar_weak2);
    progress_progressbar.set_fraction(0.5);

.
.
.
}

from examples.

jpercyasnet avatar jpercyasnet commented on August 22, 2024

from your suggested discussion, to execute progressbar.set_fraction one has to use this code:
progress_progressbar.set_fraction(somef64variable);
while gtk::events_pending() {
gtk::main_iteration_do(true);
}
I really appreciate your assistance.

from examples.

mmstick avatar mmstick commented on August 22, 2024

GTK signals are always blocking operations. This means that if you need to do a long-running task, it should be spawned in the background. How you keep up with progress is up to you -- atomics are often a good idea alongside a gtk::idle_add() to check up with the progress over time.

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.