aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-world.rs
blob: fb15d853c2b5e6981c134a27c9242b4e08c8c71e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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,
        );
    }
}