wxrust

Crates.iowxrust
lib.rswxrust
version0.0.1-alpha
sourcesrc
created_at2022-09-07 22:07:53.028735
updated_at2022-09-07 22:07:53.028735
descriptionBinding for the wxCore library of the wxWidgets toolkit.
homepage
repository
max_upload_size
id660646
size3,931,099
KENZ (kenz-gelsoft)

documentation

README

wx(wxrust)

This crate is a binding to the wxCore library of the wxWidgets toolkit.

This crate is wxrust not wx in crates.io as the name is already in use.

It is recommended to specify dependency to this library with renaming like this:

[dependencies]
wx = { version = "0.0.*", package = "wxrust" }

Example

#![windows_subsystem = "windows"]

use wx;
use wx::methods::*;

fn main() {
    wx::App::run(|_| {
        let frame = wx::Frame::builder(wx::Window::none())
            .title("Hello, 世界")
            .build();
        let button = wx::Button::builder(Some(&frame)).label("Greet").build();
        let i = 3;
        println!("i={}", i);
        let weak_button = button.to_weak_ref();
        button.bind(wx::RustEvent::Button, move |_: &wx::CommandEvent| {
            if let Some(button) = weak_button.get() {
                println!("i={}", i);
                button.set_label("clicked");
                println!("s={}", button.get_label())
            }
        });
        frame.centre(wx::BOTH);
        frame.show(true);
    });
}
Commit count: 0

cargo fmt