Skip to main content

EguiWindow

Struct EguiWindow 

Source
pub struct EguiWindow<State, U, O>
where State: 'static + Send, U: FnMut(&mut Ui, &mut ExtraOutputCommands, &mut State) + 'static + Send, O: FnMut(&FullOutput, &ViewportOutput, &mut State) + 'static + Send,
{ pub window: WindowContext, /* private fields */ }
Expand description

Handles an egui-baseview application

Fields§

§window: WindowContext

Implementations§

Source§

impl<State, U, O> EguiWindow<State, U, O>
where State: 'static + Send, U: FnMut(&mut Ui, &mut ExtraOutputCommands, &mut State) + 'static + Send, O: FnMut(&FullOutput, &ViewportOutput, &mut State) + 'static + Send,

Source

pub fn open_parented<P, B>( parent: &P, settings: EguiWindowSettings, state: State, build: B, output: O, update: U, ) -> WindowHandle
where P: HasWindowHandle, B: FnMut(&Context, &mut ExtraOutputCommands, &mut State) + 'static + Send,

Open a new child window.

  • parent - The parent window.
  • settings - The settings of the window.
  • state - The initial state of your application.
  • build - Called once before the first frame. Allows you to do setup code and to call ctx.set_fonts(). Optional.
  • output - Called after each update. Can be used to read egui’s output commands to perform actions, i.e. asking the host to resize the window if a command to resize the window is present. Optional.
  • update - Called before each frame. Here you should update the state of your application and build the UI.
Source

pub fn open_blocking<B>( settings: EguiWindowSettings, state: State, build: B, output: O, update: U, )
where B: FnMut(&Context, &mut ExtraOutputCommands, &mut State) + 'static + Send,

Open a new window that blocks the current thread until the window is destroyed.

  • settings - The settings of the window.
  • state - The initial state of your application.
  • build - Called once before the first frame. Allows you to do setup code and to call ctx.set_fonts(). Optional.
  • output - Called after each update. Can be used to read egui’s output commands to perform actions, i.e. asking the host to resize the window if a command to resize the window is present. Optional.
  • update - Called before each frame. Here you should update the state of your application and build the UI.

Trait Implementations§

Source§

impl<State, U, O> WindowHandler for EguiWindow<State, U, O>
where State: 'static + Send, U: FnMut(&mut Ui, &mut ExtraOutputCommands, &mut State) + 'static + Send, O: FnMut(&FullOutput, &ViewportOutput, &mut State) + 'static + Send,

Source§

fn on_frame(&self)

Source§

fn resized(&self, new_size: WindowSize)

Source§

fn on_event(&self, event: Event) -> EventStatus

Auto Trait Implementations§

§

impl<State, U, O> !Freeze for EguiWindow<State, U, O>

§

impl<State, U, O> !RefUnwindSafe for EguiWindow<State, U, O>

§

impl<State, U, O> !Send for EguiWindow<State, U, O>

§

impl<State, U, O> !Sync for EguiWindow<State, U, O>

§

impl<State, U, O> !UnwindSafe for EguiWindow<State, U, O>

§

impl<State, U, O> Unpin for EguiWindow<State, U, O>
where State: Unpin, U: Unpin, O: Unpin,

§

impl<State, U, O> UnsafeUnpin for EguiWindow<State, U, O>
where State: UnsafeUnpin, U: UnsafeUnpin, O: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more