[][src]Struct imgui::Window

#[must_use]pub struct Window<'a> { /* fields omitted */ }

Builder for a window

Implementations

impl<'a> Window<'a>[src]

pub fn new(name: &ImStr) -> Window[src]

Creates a new window builder with the given name

pub fn opened(self, opened: &'a mut bool) -> Self[src]

Enables the window close button, which sets the passed boolean to false when clicked

pub fn flags(self, flags: WindowFlags) -> Self[src]

Replace current window flags with the given value

pub fn position(self, position: [f32; 2], condition: Condition) -> Self[src]

Sets the window position, which is applied based on the given condition value

pub fn position_pivot(self, pivot: [f32; 2]) -> Self[src]

Sets the window position pivot, which can be used to adjust the alignment of the window relative to the position.

For example, pass [0.5, 0.5] to center the window on the position. Does nothing if window position is not also set with position().

pub fn size(self, size: [f32; 2], condition: Condition) -> Self[src]

Sets the window size, which is applied based on the given condition value

pub fn size_constraints(self, size_min: [f32; 2], size_max: [f32; 2]) -> Self[src]

Sets window size constraints.

Use -1.0, -1.0 on either X or Y axis to preserve current size.

pub fn content_size(self, size: [f32; 2]) -> Self[src]

Sets the window content size, which can be used to enforce scrollbars.

Does not include window decorations (title bar, menu bar, etc.). Set one of the values to 0.0 to leave the size automatic.

pub fn collapsed(self, collapsed: bool, condition: Condition) -> Self[src]

Sets the window collapse state, which is applied based on the given condition value

pub fn focused(self, focused: bool) -> Self[src]

Sets the window focused state, which can be used to bring the window to front

pub fn bg_alpha(self, bg_alpha: f32) -> Self[src]

Sets the background color alpha value.

See also draw_background

pub fn title_bar(self, value: bool) -> Self[src]

Enables/disables the title bar.

Enabled by default.

pub fn resizable(self, value: bool) -> Self[src]

Enables/disables resizing with the lower-right grip.

Enabled by default.

pub fn movable(self, value: bool) -> Self[src]

Enables/disables moving the window.

Enabled by default.

pub fn scroll_bar(self, value: bool) -> Self[src]

Enables/disables scrollbars (scrolling is still possible with the mouse or programmatically).

Enabled by default.

pub fn scrollable(self, value: bool) -> Self[src]

Enables/disables vertical scrolling with the mouse wheel.

Enabled by default. When enabled, child windows forward the mouse wheel to the parent unless NO_SCROLLBAR is also set.

pub fn collapsible(self, value: bool) -> Self[src]

Enables/disables collapsing the window by double-clicking it.

Enabled by default.

pub fn always_auto_resize(self, value: bool) -> Self[src]

Enables/disables resizing the window to its content on every frame.

Disabled by default.

pub fn draw_background(self, value: bool) -> Self[src]

Enables/disables drawing of background color and outside border.

Enabled by default.

pub fn save_settings(self, value: bool) -> Self[src]

Enables/disables loading and saving of settings (e.g. from/to an .ini file).

Enabled by default.

pub fn mouse_inputs(self, value: bool) -> Self[src]

Enables/disables catching mouse input.

Enabled by default. Note: Hovering test will pass through when disabled

pub fn menu_bar(self, value: bool) -> Self[src]

Enables/disables the menu bar.

Disabled by default.

pub fn horizontal_scrollbar(self, value: bool) -> Self[src]

Enables/disables the horizontal scrollbar.

Disabled by default.

pub fn focus_on_appearing(self, value: bool) -> Self[src]

Enables/disables taking focus when transitioning from hidden to visible state.

Enabled by default.

pub fn bring_to_front_on_focus(self, value: bool) -> Self[src]

Enables/disables bringing the window to front when taking focus (e.g. clicking it or programmatically giving it focus).

Enabled by default.

pub fn always_vertical_scrollbar(self, value: bool) -> Self[src]

When enabled, forces the vertical scrollbar to render regardless of the content size.

Disabled by default.

pub fn always_horizontal_scrollbar(self, value: bool) -> Self[src]

When enabled, forces the horizontal scrollbar to render regardless of the content size.

Disabled by default.

pub fn always_use_window_padding(self, value: bool) -> Self[src]

When enabled, ensures child windows without border use style.window_padding.

Disabled by default.

pub fn nav_inputs(self, value: bool) -> Self[src]

Enables/disables gamepad/keyboard navigation within the window.

Enabled by default.

pub fn nav_focus(self, value: bool) -> Self[src]

Enables/disables focusing toward this window with gamepad/keyboard navigation (e.g. CTRL+TAB).

Enabled by default.

pub fn unsaved_document(self, value: bool) -> Self[src]

When enabled, appends '*' to title without affecting the ID, as a convenience.

Disabled by default.

pub fn no_nav(self) -> Self[src]

Disable gamepad/keyboard navigation and focusing.

Shorthand for

.nav_inputs(false)
.nav_focus(false)

pub fn no_decoration(self) -> Self[src]

Disable all window decorations.

Shorthand for

.title_bar(false)
.resizable(false)
.scroll_bar(false)
.collapsible(false)

pub fn no_inputs(self) -> Self[src]

Don't handle input.

Shorthand for

.mouse_inputs(false)
.nav_inputs(false)
.nav_focus(false)

#[must_use]pub fn begin(self, ui: &Ui) -> Option<WindowToken>[src]

Creates a window and starts appending to it.

Returns Some(WindowToken) if the window is visible. After content has been rendered, the token must be ended by calling .end().

Returns None if the window is not visible and no content should be rendered.

pub fn build<F: FnOnce()>(self, ui: &Ui, f: F)[src]

Creates a window and runs a closure to construct the contents.

Note: the closure is not called if no window content is visible (e.g. window is collapsed or fully clipped).

Trait Implementations

impl<'a> Debug for Window<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Window<'a>

impl<'a> Send for Window<'a>

impl<'a> Sync for Window<'a>

impl<'a> Unpin for Window<'a>

impl<'a> !UnwindSafe for Window<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.