Skip to content

Commit

Permalink
book: Clarify function in main_event_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Oct 9, 2023
1 parent 46c96e5 commit 8270e05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions book/listings/main_event_loop/4/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use glib::{clone, timeout_future_seconds, MainContext, Priority};
use glib::{clone, MainContext, Priority};
use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow, Button};

Expand Down Expand Up @@ -34,7 +34,7 @@ fn build_ui(app: &Application) {
main_context.spawn_local(clone!(@strong sender => async move {
// Deactivate the button until the operation is done
sender.send(false).expect("Could not send through channel");
timeout_future_seconds(5).await;
glib::timeout_future_seconds(5).await;
// Activate the button again
sender.send(true).expect("Could not send through channel");
}));
Expand Down
4 changes: 2 additions & 2 deletions book/listings/main_event_loop/5/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use glib::{clone, timeout_future_seconds, MainContext};
use glib::{clone, MainContext};
use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow, Button};

Expand Down Expand Up @@ -33,7 +33,7 @@ fn build_ui(app: &Application) {
main_context.spawn_local(clone!(@weak button => async move {
// Deactivate the button until the operation is done
button.set_sensitive(false);
timeout_future_seconds(5).await;
glib::timeout_future_seconds(5).await;
// Activate the button again
button.set_sensitive(true);
}));
Expand Down

0 comments on commit 8270e05

Please sign in to comment.