File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
book/listings/main_event_loop Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- use glib:: { clone, timeout_future_seconds , MainContext , Priority } ;
1
+ use glib:: { clone, MainContext , Priority } ;
2
2
use gtk:: prelude:: * ;
3
3
use gtk:: { glib, Application , ApplicationWindow , Button } ;
4
4
@@ -34,7 +34,7 @@ fn build_ui(app: &Application) {
34
34
main_context. spawn_local ( clone ! ( @strong sender => async move {
35
35
// Deactivate the button until the operation is done
36
36
sender. send( false ) . expect( "Could not send through channel" ) ;
37
- timeout_future_seconds( 5 ) . await ;
37
+ glib :: timeout_future_seconds( 5 ) . await ;
38
38
// Activate the button again
39
39
sender. send( true ) . expect( "Could not send through channel" ) ;
40
40
} ) ) ;
Original file line number Diff line number Diff line change 1
- use glib:: { clone, timeout_future_seconds , MainContext } ;
1
+ use glib:: { clone, MainContext } ;
2
2
use gtk:: prelude:: * ;
3
3
use gtk:: { glib, Application , ApplicationWindow , Button } ;
4
4
@@ -33,7 +33,7 @@ fn build_ui(app: &Application) {
33
33
main_context. spawn_local ( clone ! ( @weak button => async move {
34
34
// Deactivate the button until the operation is done
35
35
button. set_sensitive( false ) ;
36
- timeout_future_seconds( 5 ) . await ;
36
+ glib :: timeout_future_seconds( 5 ) . await ;
37
37
// Activate the button again
38
38
button. set_sensitive( true ) ;
39
39
} ) ) ;
You can’t perform that action at this time.
0 commit comments