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:
TOML
[dependencies]
wx = { version = "0.0.*", package = "wxrust" }
```compile_fail
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 weakbutton = button.toweakref(); button.bind(wx::RustEvent::Button, move |: &wx::CommandEvent| { if let Some(button) = weakbutton.get() { println!("i={}", i); button.setlabel("clicked"); println!("s={}", button.getlabel()) } }); frame.centre(wx::BOTH); frame.show(true); }); } ```