@@ -69,7 +69,7 @@ impl Widget for Text {
6969 type Msg = TextMsg ;
7070 type Root = gtk:: Box ;
7171
72- fn model ( _: ( ) ) -> TextModel {
72+ fn model ( _: & Relm < Self > , _ : ( ) ) -> TextModel {
7373 TextModel {
7474 content : String :: new ( ) ,
7575 }
@@ -130,7 +130,7 @@ impl Widget for Counter {
130130 type Msg = CounterMsg ;
131131 type Root = gtk:: Box ;
132132
133- fn model ( _: ( ) ) -> CounterModel {
133+ fn model ( _: & Relm < Self > , _ : ( ) ) -> CounterModel {
134134 CounterModel {
135135 counter : 0 ,
136136 }
@@ -203,7 +203,7 @@ impl Widget for Win {
203203 type Msg = Msg ;
204204 type Root = Window ;
205205
206- fn model ( _: ( ) ) -> Model {
206+ fn model ( _: & Relm < Self > , _ : ( ) ) -> Model {
207207 Model {
208208 counter : 0 ,
209209 }
@@ -253,7 +253,7 @@ impl Widget for Win {
253253 let Win { ref counter1, ref counter2, ref text, ref window, .. } = * win. borrow ( ) ;
254254 connect ! ( text@Change ( text) , relm, TextChange ( text) ) ;
255255 connect ! ( text@Change ( _) , counter1, with win_clone win_clone. inc( ) ) ;
256- connect ! ( counter1@Increment , counter2, Increment ) ;
256+ connect ! ( counter1@Increment , counter2, Decrement ) ;
257257 connect ! ( button, connect_clicked( _) , counter1, Decrement ) ;
258258
259259 window. add ( & hbox) ;
@@ -268,7 +268,7 @@ impl Widget for Win {
268268}
269269
270270impl Win {
271- fn inc ( & self ) -> CounterMsg {
271+ fn inc ( & mut self ) -> CounterMsg {
272272 Increment
273273 }
274274}
0 commit comments