diff options
author | Melody Horn <melody@boringcactus.com> | 2021-10-29 20:19:57 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-10-29 20:19:57 -0600 |
commit | 847135ed1e1e7322b63b0063be8e40d706c4954f (patch) | |
tree | dd26ddf0ed7cfb4b3b0a15d83a37e513467bcc95 /examples | |
download | shit-wx-sys-847135ed1e1e7322b63b0063be8e40d706c4954f.tar.gz shit-wx-sys-847135ed1e1e7322b63b0063be8e40d706c4954f.zip |
oh my god
Diffstat (limited to 'examples')
-rw-r--r-- | examples/hello-world.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/hello-world.rs b/examples/hello-world.rs new file mode 100644 index 0000000..fb15d85 --- /dev/null +++ b/examples/hello-world.rs @@ -0,0 +1,20 @@ +use std::ffi::CString; + +use shit_wx_sys::*; + +fn main() { + unsafe { + let message = "It's alive!!"; + let c_string_message = CString::new(message).unwrap(); + let message = + wxString::FromAscii(c_string_message.as_ptr(), message.len().try_into().unwrap()); + wxMessageBox( + (&message) as *const wxString, + (&message) as *const wxString, + (wxOK as i32) | wxGeometryCentre_wxCENTER, + NULL as *mut wxWindow, + wxDefaultCoord, + wxDefaultCoord, + ); + } +} |