Function ns_default_run_loop_mode

Source
pub unsafe fn ns_default_run_loop_mode() -> *mut NSRunLoopMode
Examples found in repository?
examples/hello_triangle.rs (line 219)
214unsafe fn poll_events(app: &NSApplication, termination_requested: &mut bool) {
215  loop {
216    let event = app.next_event_matching_mask_until_date_in_mode_dequeue(
217      NSEventMask::Any,
218      NSDate::distant_past(),
219      util::ns_default_run_loop_mode(),
220      true
221    );
222
223    match event.as_mut() {
224      None => break,
225      Some(event) => {
226        match event.event_type() {
227          NSEventType::KeyDown => {
228            *termination_requested = true
229          },
230          _ => app.send_event(event)
231        }
232      }
233    }
234  }
235}