Trait cushy::window::MakeWindow

source ·
pub trait MakeWindow {
    type Behavior: WindowBehavior;

    // Required method
    fn make_window(self) -> Window<Self::Behavior>;

    // Provided methods
    fn open_centered<App>(self, app: &mut App) -> Result<WindowHandle>
       where Self: Sized,
             App: Application + ?Sized { ... }
    fn run_centered(self) -> Result
       where Self: Sized { ... }
    fn run_centered_in(self, app: PendingApp) -> Result
       where Self: Sized { ... }
}
Expand description

A type that can be made into a Window.

Required Associated Types§

source

type Behavior: WindowBehavior

The behavior associated with this window.

Required Methods§

source

fn make_window(self) -> Window<Self::Behavior>

Returns a new window from self.

Provided Methods§

source

fn open_centered<App>(self, app: &mut App) -> Result<WindowHandle>
where Self: Sized, App: Application + ?Sized,

Opens self in the center of the monitor the window initially appears on.

source

fn run_centered(self) -> Result
where Self: Sized,

Runs self in the center of the monitor the window initially appears on.

source

fn run_centered_in(self, app: PendingApp) -> Result
where Self: Sized,

Runs app after opening self in the center of the monitor the window initially appears on.

Implementors§

source§

impl MakeWindow for DebugContext

source§

impl<Behavior> MakeWindow for Window<Behavior>
where Behavior: WindowBehavior,

§

type Behavior = Behavior

source§

impl<T> MakeWindow for T
where T: MakeWidget,