Coder Social home page Coder Social logo

Comments (3)

han1548772930 avatar han1548772930 commented on July 21, 2024

ok , I've tried it so far but I can't confirm if it's the way it should be.
But there is no such program in the tray in the lower right corner.

use std::thread;

use slint::run_event_loop_until_quit;

slint::include_modules!();

fn main() -> Result<(), slint::PlatformError> {
    let ui = AppWindow::new()?;

    ui.on_request_increase_value({
        let ui_handle = ui.as_weak();
        move || {
            let ui = ui_handle.unwrap();
            ui.set_counter(ui.get_counter() + 1);
            let _ = run_event_loop_until_quit();
            let _ = ui.window().hide();
            thread::sleep(std::time::Duration::from_secs(3));
            let _ = ui.window().show();
        }
    });

    // let _ = std::thread::spawn(move || {
    //     let _ = run_event_loop_until_quit();
    // });

    ui.run()
}

from slint.

han1548772930 avatar han1548772930 commented on July 21, 2024

https://github.com/Guiguiprim/slint_systry_app

from slint.

hunger avatar hunger commented on July 21, 2024

Try

let _ = ui.show();
run_event_loop_until_quit();

instead of ui.run().

from slint.

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.