flux-tui 0.5.0

Fast and lightweight Terminal UI drawing library
Documentation
use super::*;
use std::{cell::*, rc::Rc};


pub trait WindowHelper: Window {
	/// Helper method for [WindowEventQueue::provoke_changed_property]
	fn provoke_changed_property(&self, property: WindowProperty) {
		WindowEventQueue::provoke_changed_property(self.uid(), property);
	}
}

impl<T: Window> WindowHelper for T {}

pub struct WindowFactory {}

impl WindowFactory {
	/// Create a new [Rc<RefCell<_>>] using the [Window]'s [Default] implementation
	#[inline(always)]
	pub fn create<T>() -> Rc<RefCell<T>>
	where T: Window + Default {
		Rc::new(RefCell::new(T::default()))
	}
}