Add Dialog::buttons to iterate on buttons

This commit is contained in:
Alexandre Bury 2018-01-12 09:33:54 +01:00
parent 56f81eee7c
commit 3058816f1a

View File

@ -216,6 +216,13 @@ impl Dialog {
self
}
/// Returns an iterator on this buttons for this dialog.
pub fn buttons_mut<'a>(
&'a mut self
) -> Box<'a + Iterator<Item = &'a mut Button>> {
Box::new(self.buttons.iter_mut().map(|b| &mut b.button.view))
}
// Private methods
// An event is received while the content is in focus