From 3058816f1aec0df8bba79085cc86726e15bd9fea Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Fri, 12 Jan 2018 09:33:54 +0100 Subject: [PATCH] Add Dialog::buttons to iterate on buttons --- src/views/dialog.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/dialog.rs b/src/views/dialog.rs index 63a610b..14f2b75 100644 --- a/src/views/dialog.rs +++ b/src/views/dialog.rs @@ -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> { + Box::new(self.buttons.iter_mut().map(|b| &mut b.button.view)) + } + // Private methods // An event is received while the content is in focus