File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -139,18 +139,18 @@ impl Update for Win {
139
139
Quit => gtk:: main_quit ( ) ,
140
140
MinusToggle => {
141
141
if self . minus_button . widget ( ) . get_active ( ) {
142
- self . plus_button . stream ( ) . emit ( Uncheck ) ;
142
+ self . plus_button . emit ( Uncheck ) ;
143
143
}
144
144
else {
145
- self . plus_button . stream ( ) . emit ( Check ) ;
145
+ self . plus_button . emit ( Check ) ;
146
146
}
147
147
} ,
148
148
PlusToggle => {
149
149
if self . plus_button . widget ( ) . get_active ( ) {
150
- self . minus_button . stream ( ) . emit ( Uncheck ) ;
150
+ self . minus_button . emit ( Uncheck ) ;
151
151
}
152
152
else {
153
- self . minus_button . stream ( ) . emit ( Check ) ;
153
+ self . minus_button . emit ( Check ) ;
154
154
}
155
155
} ,
156
156
}
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ impl<WIDGET: Widget> Component<WIDGET> {
51
51
}
52
52
}
53
53
54
+ /// Emit a message of the widget stream.
55
+ pub fn emit ( & self , msg : WIDGET :: Msg ) {
56
+ self . stream . emit ( msg) ;
57
+ }
58
+
54
59
/// Get the event stream of the component.
55
60
/// This is used internally by the library.
56
61
pub fn stream ( & self ) -> & EventStream < WIDGET :: Msg > {
Original file line number Diff line number Diff line change @@ -62,10 +62,15 @@ impl<WIDGET: Container + Widget> ContainerComponent<WIDGET> {
62
62
component
63
63
}
64
64
65
+ /// Emit a message of the widget stream.
66
+ pub fn emit ( & self , msg : WIDGET :: Msg ) {
67
+ self . stream ( ) . emit ( msg) ;
68
+ }
69
+
65
70
/// Get the event stream of the component.
66
71
/// This is used internally by the library.
67
72
pub fn stream ( & self ) -> & EventStream < WIDGET :: Msg > {
68
- & self . component . stream ( )
73
+ self . component . stream ( )
69
74
}
70
75
71
76
// TODO: add delete methods?
You can’t perform that action at this time.
0 commit comments