aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/frame-demo.rs1
-rw-r--r--examples/hello-world.rs20
2 files changed, 3 insertions, 18 deletions
diff --git a/examples/frame-demo.rs b/examples/frame-demo.rs
index 2b69eb7..c422bdb 100644
--- a/examples/frame-demo.rs
+++ b/examples/frame-demo.rs
@@ -6,6 +6,7 @@ use std::ptr::{null, null_mut};
use shit_wx_sys::*;
fn main() {
+ #[cfg(unix)]
unsafe {
let app = wxApp::new();
diff --git a/examples/hello-world.rs b/examples/hello-world.rs
index 9fe521c..9928016 100644
--- a/examples/hello-world.rs
+++ b/examples/hello-world.rs
@@ -1,21 +1,5 @@
-use std::ffi::CString;
-use std::ptr::null_mut;
-
-use shit_wx_sys::*;
+use shit_wx_sys as wx;
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_mut(),
- wxDefaultCoord,
- wxDefaultCoord,
- );
- }
+ wx::message_box();
}