This repository was archived by the owner on Mar 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
composite_template/example_application_window Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ impl ApplicationImpl for SimpleApplication {
29
29
/// aksed to present itself.
30
30
fn activate ( & self , app : & Self :: Type ) {
31
31
let app = app. downcast_ref :: < super :: SimpleApplication > ( ) . unwrap ( ) ;
32
- let priv_ = SimpleApplication :: from_instance ( app) ;
32
+ let priv_ = app. imp ( ) ;
33
33
let window = priv_
34
34
. window
35
35
. get ( )
@@ -49,7 +49,7 @@ impl ApplicationImpl for SimpleApplication {
49
49
self . parent_startup ( app) ;
50
50
51
51
let app = app. downcast_ref :: < super :: SimpleApplication > ( ) . unwrap ( ) ;
52
- let priv_ = SimpleApplication :: from_instance ( app) ;
52
+ let priv_ = app. imp ( ) ;
53
53
let window = SimpleWindow :: new ( app) ;
54
54
priv_
55
55
. window
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl ObjectImpl for SimpleWindow {
41
41
// Connect our method `on_increment_clicked` to be called
42
42
// when the increment button is clicked.
43
43
increment. connect_clicked ( clone ! ( @weak obj => move |_| {
44
- let priv_ = SimpleWindow :: from_instance ( & obj) ;
44
+ let priv_ = obj. imp ( ) ;
45
45
priv_. on_increment_clicked( ) ;
46
46
} ) ) ;
47
47
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ impl ExampleApplicationWindow {
18
18
fn init_label ( & self ) {
19
19
// To access fields such as template children, you must get
20
20
// the private struct.
21
- let self_ = imp:: ExampleApplicationWindow :: from_instance ( self ) ;
21
+ let self_ = self . imp ( ) ;
22
22
self_
23
23
. subtitle
24
24
. set_text ( "This is an example window made using composite templates" ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ impl Model {
19
19
}
20
20
21
21
pub fn append ( & self , obj : & RowData ) {
22
- let self_ = imp:: Model :: from_instance ( self ) ;
22
+ let self_ = self . imp ( ) ;
23
23
let index = {
24
24
// Borrow the data only once and ensure the borrow guard is dropped
25
25
// before we emit the items_changed signal because the view
@@ -33,7 +33,7 @@ impl Model {
33
33
}
34
34
35
35
pub fn remove ( & self , index : u32 ) {
36
- let self_ = imp:: Model :: from_instance ( self ) ;
36
+ let self_ = self . imp ( ) ;
37
37
self_. 0 . borrow_mut ( ) . remove ( index as usize ) ;
38
38
// Emits a signal that 1 item was removed, 0 added at the position index
39
39
self . items_changed ( index, 1 , 0 ) ;
You can’t perform that action at this time.
0 commit comments