Function wx_rs::get_event_type

source ·
pub fn get_event_type(event: *const c_void) -> EventType
Examples found in repository?
examples/hello.rs (line 11)
10
11
12
13
14
15
16
17
extern "C" fn handle_event(event: *const c_void) {
    match wx_rs::get_event_type(event) {
        e if e != wx_rs::EventType::Timer => {
            wx_rs::set_status_text(&format!("Got event: {:?}", e));
        }
        _ => (),
    }
}
More examples
Hide additional examples
examples/cursor.rs (line 14)
13
14
15
16
17
18
19
20
21
22
extern "C" fn handle_event(event: *const c_void) {
    match wx_rs::get_event_type(event) {
        EventType::MouseLeftUp => {
            let cursor = CURSORS.with(|r| unsafe { r.get().as_mut().unwrap().next().unwrap() });
            println!("set_cursor: {:?}", cursor);
            wx_rs::set_cursor(*cursor);
        }
        _ => (),
    }
}