[−][src]Struct cat_engine::DynamicWindow
Окно, которое использует "страницы" как типажи-объекты для обработки событий. A window that uses 'pages' as trait objects to handle the events.
Все события прописываются с помощь типажа WindowPage
и обработываются сразу же после их появления.
"Страницы" можно переключать на ходу. Смена "страницы" до запуска цикла вызывает панику.
All the events are implemented with WindowPage
and handled immediately after emited.
A 'page' may be switched while the event loop is running. Panics if a 'page' is changed before starting the cycle.
Implementations
impl<'a, O: PartialEq> DynamicWindow<'a, O>
[src]
pub fn new<F>(setting: F) -> Result<DynamicWindow<'a, O>, DisplayCreationError> where
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
[src]
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
Создаёт окно.
Creates the window.
pub fn set_page_raw(&mut self, page: PageRef<'a, O>)
[src]
Устанавливает страницу.
Управление переходит ей со следующего события.
Sets the page.
It starts to operate with the next event.
pub fn set_page(&mut self, page: PageRef<'a, O>)
[src]
Устанавливает новую страницу, сохраняя прошлую.
Управление переходит ей со следующего события.
Sets a new page saving the last one.
It starts to operate with the next event.
pub fn change_page(&mut self, page: PageRef<'a, O>) -> Option<PageRef<'a, O>>
[src]
Устанавливает страницу.
Управление переходит ей со следующего события.
Возвращает прошлую страницу.
Sets the page.
It starts to operate with the next event.
Returns the last page.
pub fn take_old_page(&mut self) -> Option<PageRef<'a, O>>
[src]
Возвращает прошлую страницу.
Returns the last page.
pub fn run(self, page: PageRef<'a, O>) -> O
[src]
Запускает обработчик событий с данной страницей.
Starts the event loop with the given page.
pub fn stop_events(&self) -> Result<(), EventLoopClosed<InnerWindowEvent>>
[src]
Останавливает обработку событий, отправляя событие для остановки.
Возвращает Err
, если обработчик уже остановлен.
Stops the event loop by sending the stopping event.
Returns Err
if the loop is already stopped.
Trait Implementations
impl<'a, O: PartialEq> Window for DynamicWindow<'a, O>
[src]
pub fn window_base_mut(&mut self) -> &mut WindowBase
[src]
pub fn window_base(&self) -> &WindowBase
[src]
pub fn raw(
window_builder: WindowBuilder,
context_builder: ContextBuilder<'_, NotCurrent>,
graphics_settings: GraphicsSettings,
event_loop: EventLoop<InnerWindowEvent>,
general_settings: GeneralSettings
) -> Result<DynamicWindow<'a, O>, DisplayCreationError>
[src]
window_builder: WindowBuilder,
context_builder: ContextBuilder<'_, NotCurrent>,
graphics_settings: GraphicsSettings,
event_loop: EventLoop<InnerWindowEvent>,
general_settings: GeneralSettings
) -> Result<DynamicWindow<'a, O>, DisplayCreationError>
pub fn new<F>(setting: F) -> Result<Self, DisplayCreationError> where
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
[src]
F: FnOnce(Vec<MonitorHandle>, &mut WindowSettings),
pub fn display(&self) -> &Display
[src]
pub fn graphics2d(&mut self) -> &mut Graphics2D
[src]
pub fn draw<F: FnOnce(&mut DrawParameters<'_>, &mut Graphics<'_, '_>)>(
&mut self,
f: F
) -> Result<(), SwapBuffersError>
[src]
&mut self,
f: F
) -> Result<(), SwapBuffersError>
pub fn screenshot(&self) -> Option<DynamicImage>
[src]
pub fn save_screenshot<P: AsRef<Path>>(&self, path: P)
[src]
Auto Trait Implementations
impl<'a, O> !RefUnwindSafe for DynamicWindow<'a, O>
impl<'a, O> !Send for DynamicWindow<'a, O>
impl<'a, O> !Sync for DynamicWindow<'a, O>
impl<'a, O> Unpin for DynamicWindow<'a, O>
impl<'a, O> !UnwindSafe for DynamicWindow<'a, O>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,