glib::source

Function idle_source_new

Source
pub fn idle_source_new<F>(
    name: Option<&str>,
    priority: Priority,
    func: F,
) -> Source
where F: FnMut() -> ControlFlow + Send + 'static,
Expand description

Adds a closure to be called by the main loop the return Source is attached to when it’s idle.

func will be called repeatedly until it returns ControlFlow::Break.