From 847135ed1e1e7322b63b0063be8e40d706c4954f Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Fri, 29 Oct 2021 20:19:57 -0600 Subject: oh my god --- examples/hello-world.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/hello-world.rs (limited to 'examples') 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, + ); + } +} -- cgit v1.2.3