Struct iui::EventLoop [−][src]
pub struct EventLoop { /* fields omitted */ }
Provides fine-grained control over the user interface event loop, exposing the on_tick
event
which allows integration with other event loops, custom logic on event ticks, etc.
Be aware the Cocoa (GUI toolkit on Mac OS) requires that the first thread spawned controls
the UI, so do not spin off your UI interactions into an alternative thread. You're likely to
have problems on Mac OS.
Methods
impl EventLoop
[src]
impl EventLoop
pub fn on_tick<F: FnMut() + 'static>(&mut self, _ctx: &UI, callback: F)
[src]
pub fn on_tick<F: FnMut() + 'static>(&mut self, _ctx: &UI, callback: F)
Set the given callback to run when the event loop is executed. Note that if integrating other event loops you should consider the potential benefits and drawbacks of the various run modes.
pub fn next_tick(&mut self, _ctx: &UI) -> bool
[src]
pub fn next_tick(&mut self, _ctx: &UI) -> bool
Executes a tick in the event loop, returning immediately.
The on_tick
callback is executed after the UI step.
Returns true
if the application should continue running, and false
if it should quit.
pub fn next_event_tick(&mut self, _ctx: &UI) -> bool
[src]
pub fn next_event_tick(&mut self, _ctx: &UI) -> bool
Hands control to the event loop until the next UI event occurs.
The on_tick
callback is executed after the UI step.
Returns true
if the application should continue running, and false
if it should quit.
pub fn run(&mut self, ctx: &UI)
[src]
pub fn run(&mut self, ctx: &UI)
Hands control to the event loop until UI::quit()
is called,
running the callback given with on_tick
after each UI event.
pub fn run_delay(&mut self, ctx: &UI, delay_ms: u32)
[src]
pub fn run_delay(&mut self, ctx: &UI, delay_ms: u32)
Hands control to the event loop until UI::quit()
is called,
running the callback given with on_tick
approximately every
delay
milliseconds.