use super::ContainerChild;
use gtk::prelude::{Cast, ContainerExt, IsA};
pub trait RelmIterChildrenExt: ContainerChild + IsA<gtk::Container> {
fn iter_children(&self) -> Box<dyn DoubleEndedIterator<Item = Self::Child>> {
let self_container: >k::Container = self.upcast_ref::<gtk::Container>();
let children = self_container.children();
Box::new(
children
.into_iter()
.filter_map(|c| c.downcast::<Self::Child>().ok()),
)
}
}
impl RelmIterChildrenExt for gtk::Box {}
impl RelmIterChildrenExt for gtk::ListBox {}
impl RelmIterChildrenExt for gtk::FlowBox {}
impl RelmIterChildrenExt for gtk::Grid {}
impl RelmIterChildrenExt for gtk::Stack {}