aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-10-30 00:21:27 -0600
committerMelody Horn <melody@boringcactus.com>2021-10-30 00:21:27 -0600
commit2c422c2841f24be9a3fb65b1bf090bc847bae2b4 (patch)
tree77949cf90ad6cb7d8ad4f19a0b9b50fc7102861a /examples
parent2d242f308a0c14aa46407b20afaadead9b22150a (diff)
downloadshit-wx-sys-2c422c2841f24be9a3fb65b1bf090bc847bae2b4.tar.gz
shit-wx-sys-2c422c2841f24be9a3fb65b1bf090bc847bae2b4.zip
..what is even fucking happening
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();
}