diff options
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, + ); + } +} |