Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit ef64376

Browse files
Adapt to glib::Continue rename
1 parent ba8b0af commit ef64376

File tree

7 files changed

+18
-19
lines changed

7 files changed

+18
-19
lines changed

examples/cairo_threads/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn build_ui(application: &gtk::Application) {
128128

129129
area.queue_draw_area(origins[thread_num].0, origins[thread_num].1, WIDTH, HEIGHT);
130130

131-
Continue(true)
131+
glib::ControlFlow::Continue
132132
});
133133

134134
window.show_all();

examples/clock/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ fn build_ui(application: &gtk::Application) {
2626
let tick = move || {
2727
let time = current_time();
2828
label.set_text(&time);
29-
// we could return glib::Continue(false) to stop our clock after this tick
30-
glib::Continue(true)
29+
// we could return glib::ControlFlow::Break to stop our clock after this tick
30+
glib::ControlFlow::Continue
3131
};
3232

3333
// executes the closure once every second

examples/list_store/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ fn build_ui(application: &gtk::Application) {
6363

6464
glib::timeout_add_local(
6565
Duration::from_millis(80),
66-
glib::clone!(@weak model => @default-return glib::Continue(false), move || {
66+
glib::clone!(@weak model => @default-return glib::ControlFlow::Break, move || {
6767
spinner_timeout(&model);
68-
glib::Continue(false)
68+
glib::ControlFlow::Break
6969
}),
7070
);
7171
}
@@ -302,7 +302,7 @@ fn add_columns(model: &Rc<gtk::ListStore>, treeview: &gtk::TreeView) {
302302
}
303303
}
304304

305-
fn spinner_timeout(model: &gtk::ListStore) -> Continue {
305+
fn spinner_timeout(model: &gtk::ListStore) -> glib::ControlFlow {
306306
let iter = model.iter_first().unwrap();
307307
let pulse = model
308308
.value(&iter, Columns::Pulse as i32)
@@ -319,5 +319,5 @@ fn spinner_timeout(model: &gtk::ListStore) -> Continue {
319319
model.set_value(&iter, Columns::Pulse as i32 as u32, &pulse.to_value());
320320
model.set_value(&iter, Columns::Active as i32 as u32, &true.to_value());
321321

322-
Continue(true)
322+
glib::ControlFlow::Continue
323323
}

examples/multi_threading_context/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn build_ui(application: &gtk::Application) {
4848
rx.attach(None, move |text| {
4949
text_buffer.set_text(&text);
5050

51-
glib::Continue(true)
51+
glib::ControlFlow::Continue
5252
});
5353

5454
window.add(&scroll);

examples/progress_tracker/main.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Application {
6666
let _ = tx.send(None);
6767
});
6868

69-
rx.attach(None, glib::clone!(@weak active, @weak widgets => @default-return glib::Continue(false), move |value| match value {
69+
rx.attach(None, glib::clone!(@weak active, @weak widgets => @default-return glib::ControlFlow::Break, move |value| match value {
7070
Some(value) => {
7171
widgets
7272
.main_view
@@ -78,20 +78,20 @@ impl Application {
7878
.view_stack
7979
.set_visible_child(&widgets.complete_view.container);
8080

81-
glib::timeout_add_local(Duration::from_millis(1500), glib::clone!(@weak widgets => @default-return glib::Continue(false), move || {
81+
glib::timeout_add_local(Duration::from_millis(1500), glib::clone!(@weak widgets => @default-return glib::ControlFlow::Break, move || {
8282
widgets.main_view.progress.set_fraction(0.0);
8383
widgets
8484
.view_stack
8585
.set_visible_child(&widgets.main_view.container);
86-
glib::Continue(false)
86+
glib::ControlFlow::Break
8787
}));
8888
}
8989

90-
glib::Continue(true)
90+
glib::ControlFlow::Continue
9191
}
9292
None => {
9393
active.set(false);
94-
glib::Continue(false)
94+
glib::ControlFlow::Break
9595
}
9696
}));
9797
}),

examples/tree_view/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ fn build_ui(application: &gtk::Application) {
5959
.map_err(|err| {
6060
let msg = err.to_string();
6161
glib::idle_add_local(
62-
glib::clone!(@weak window => @default-return glib::Continue(false), move || {
62+
glib::clone!(@weak window => @default-return glib::ControlFlow::Break, move || {
6363
let dialog = MessageDialog::new(Some(&window), DialogFlags::MODAL,
6464
MessageType::Error, ButtonsType::Ok, &msg);
6565
dialog.connect_response(|dialog, _| dialog.close());
6666
dialog.show_all();
67-
Continue(false)
67+
glib::ControlFlow::Break
6868
}),
6969
);
7070
})

gtk/src/widget.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use gdk::{DragAction, Event, ModifierType};
44
use glib::ffi::gboolean;
55
use glib::signal::{connect_raw, Inhibit, SignalHandlerId};
66
use glib::translate::*;
7-
use glib::Continue;
87
use std::mem::transmute;
98
use std::ptr;
109

@@ -152,15 +151,15 @@ pub trait WidgetExtManual: IsA<Widget> + sealed::Sealed + 'static {
152151
}
153152

154153
#[doc(alias = "gtk_widget_add_tick_callback")]
155-
fn add_tick_callback<P: Fn(&Self, &gdk::FrameClock) -> Continue + 'static>(
154+
fn add_tick_callback<P: Fn(&Self, &gdk::FrameClock) -> glib::ControlFlow + 'static>(
156155
&self,
157156
callback: P,
158157
) -> TickCallbackId {
159158
let callback_data: Box<P> = Box::new(callback);
160159

161160
unsafe extern "C" fn callback_func<
162161
O: IsA<Widget>,
163-
P: Fn(&O, &gdk::FrameClock) -> Continue + 'static,
162+
P: Fn(&O, &gdk::FrameClock) -> glib::ControlFlow + 'static,
164163
>(
165164
widget: *mut ffi::GtkWidget,
166165
frame_clock: *mut gdk::ffi::GdkFrameClock,
@@ -176,7 +175,7 @@ pub trait WidgetExtManual: IsA<Widget> + sealed::Sealed + 'static {
176175

177176
unsafe extern "C" fn notify_func<
178177
O: IsA<Widget>,
179-
P: Fn(&O, &gdk::FrameClock) -> Continue + 'static,
178+
P: Fn(&O, &gdk::FrameClock) -> glib::ControlFlow + 'static,
180179
>(
181180
data: glib::ffi::gpointer,
182181
) {

0 commit comments

Comments
 (0)