Git Product home page Git Product logo

Comments (3)

rodrigocfd avatar rodrigocfd commented on May 24, 2024

Exactly, you can, and it's already possible.

I'm testing with Visual Studio 2019 Resource Editor, but ResEdit does the same job.

Considering you have a dialog resource with an edit and a button, your code will look like this:

use winsafe::gui;

fn main() {
    let my_main = MyMain::new();
    if let Err(e) = my_main.dlg.run_main(None) {
        eprintln!("{}", e);
    }
}

#[derive(Clone)]
pub struct MyMain {
    dlg: gui::CustomMain,
    txt: gui::Edit,
    btn: gui::Button,
}

impl MyMain {
    pub fn new() -> MyMain {
        // dialog ID = 102
        // icon ID = 101
        let dlg = gui::CustomMain::new_dlg(102, Some(101), None);

        // edit ID = 1001
        // button ID = 1002
        let txt = gui::Edit::new_dlg(&dlg, 1001);
        let btn = gui::Button::new_dlg(&dlg, 1002);

        let new_self = Self { dlg, txt, btn };
        new_self.events();
        new_self
    }

    pub fn events() {
        // ...
    }
}

You're welcome to test it.

Actually I'm finishing an example to upload to the examples folder showing exactly that.

from winsafe.

ffred avatar ffred commented on May 24, 2024

great thanks..
don't have much time actually to work with Rust, but will definitely test it soon. :-)

from winsafe.

rodrigocfd avatar rodrigocfd commented on May 24, 2024

No problem.

Feel free to open an issue if you need something.

from winsafe.

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.