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

Commit 3c602a7

Browse files
committed
Update manual code
1 parent bdc519d commit 3c602a7

24 files changed

+30
-51
lines changed

examples/css/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ fn build_ui(application: &gtk::Application) {
3737
let label = gtk::Button::with_label("hover me!");
3838
// We need to name it in order to be able to use its name as a CSS label to
3939
// apply CSS on it.
40-
gtk::WidgetExt::set_widget_name(&label, "label1");
40+
label.set_widget_name("label1");
4141

4242
let entry = gtk::Entry::new();
4343
// We need to name it in order to apply CSS on it.
44-
gtk::WidgetExt::set_widget_name(&entry, "entry1");
44+
entry.set_widget_name("entry1");
4545
entry.set_text("Some text");
4646

4747
let combo = gtk::ComboBoxText::new();

examples/gio_task/file_size/ffi.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use gtk::glib::subclass::prelude::*;
22
use gtk::glib::translate::*;
3-
use gtk::prelude::AsyncResultExt;
4-
use gtk::prelude::Cast;
5-
use gtk::prelude::FileExt;
6-
use gtk::prelude::ToValue;
3+
use gtk::prelude::*;
74
use gtk::{gio, glib};
85

96
pub type FileSize = <super::imp::FileSize as ObjectSubclass>::Instance;

examples/gio_task/file_size/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ pub mod ffi;
22
mod imp;
33

44
use gtk::glib::subclass::prelude::*;
5-
use gtk::prelude::AsyncResultExt;
6-
use gtk::prelude::Cast;
7-
use gtk::prelude::FileExt;
8-
use gtk::prelude::ToValue;
5+
use gtk::prelude::*;
96
use gtk::{gio, glib};
107

118
glib::wrapper! {

examples/overlay/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn build_ui(application: &gtk::Application) {
2121
// The overlay label.
2222
let overlay_text = gtk::Label::new(Some("0"));
2323
// We need to name it in order to apply CSS on it.
24-
gtk::WidgetExt::set_widget_name(&overlay_text, "overlay-label");
24+
overlay_text.set_widget_name("overlay-label");
2525
// We put the overlay in the top-right corner of the window.
2626
overlay_text.set_halign(gtk::Align::End);
2727
overlay_text.set_valign(gtk::Align::Start);

gio/src/cancellable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use crate::CancellableExt;
3+
use crate::prelude::*;
44

55
#[test]
66
fn check_callback() {

gio/src/file_enumerator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3+
use crate::prelude::*;
34
use crate::FileEnumerator;
4-
use crate::FileEnumeratorExt;
55
use crate::FileInfo;
66
use std::iter::Iterator;
77

gio/src/gio_future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use futures_core::task::{Context, Poll};
55
use std::future::Future;
66
use std::pin::{self, Pin};
77

8+
use crate::prelude::*;
89
use crate::Cancellable;
9-
use crate::CancellableExt;
1010

1111
pub struct GioFuture<F, O, T, E> {
1212
obj: O,

gio/src/inet_address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3+
use crate::prelude::*;
34
use crate::InetAddress;
4-
use crate::InetAddressExt;
55
use crate::SocketFamily;
66
use glib::object::IsA;
77
use glib::translate::*;

gio/src/inet_socket_address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3+
use crate::prelude::*;
34
use crate::InetAddress;
45
use crate::InetSocketAddress;
5-
use crate::InetSocketAddressExt;
66

77
use std::net::SocketAddr;
88

gio/src/input_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

33
use crate::error::to_std_io_result;
4+
use crate::prelude::*;
45
use crate::Cancellable;
56
use crate::InputStream;
67
use crate::Seekable;
7-
use crate::SeekableExt;
88
use futures_core::task::{Context, Poll};
99
use futures_io::{AsyncBufRead, AsyncRead};
1010
use glib::object::IsA;

0 commit comments

Comments
 (0)