File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,18 +139,18 @@ impl Update for Win {
139139 Quit => gtk:: main_quit ( ) ,
140140 MinusToggle => {
141141 if self . minus_button . widget ( ) . get_active ( ) {
142- self . plus_button . stream ( ) . emit ( Uncheck ) ;
142+ self . plus_button . emit ( Uncheck ) ;
143143 }
144144 else {
145- self . plus_button . stream ( ) . emit ( Check ) ;
145+ self . plus_button . emit ( Check ) ;
146146 }
147147 } ,
148148 PlusToggle => {
149149 if self . plus_button . widget ( ) . get_active ( ) {
150- self . minus_button . stream ( ) . emit ( Uncheck ) ;
150+ self . minus_button . emit ( Uncheck ) ;
151151 }
152152 else {
153- self . minus_button . stream ( ) . emit ( Check ) ;
153+ self . minus_button . emit ( Check ) ;
154154 }
155155 } ,
156156 }
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ impl<WIDGET: Widget> Component<WIDGET> {
5151 }
5252 }
5353
54+ /// Emit a message of the widget stream.
55+ pub fn emit ( & self , msg : WIDGET :: Msg ) {
56+ self . stream . emit ( msg) ;
57+ }
58+
5459 /// Get the event stream of the component.
5560 /// This is used internally by the library.
5661 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> {
6262 component
6363 }
6464
65+ /// Emit a message of the widget stream.
66+ pub fn emit ( & self , msg : WIDGET :: Msg ) {
67+ self . stream ( ) . emit ( msg) ;
68+ }
69+
6570 /// Get the event stream of the component.
6671 /// This is used internally by the library.
6772 pub fn stream ( & self ) -> & EventStream < WIDGET :: Msg > {
68- & self . component . stream ( )
73+ self . component . stream ( )
6974 }
7075
7176 // TODO: add delete methods?
You can’t perform that action at this time.
0 commit comments