get_event_type

Function get_event_type 

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