Struct imgui::ChildWindow[][src]

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

Builder for a child window

Implementations

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

pub fn new<T: Into<Id<'a>>>(id: T) -> ChildWindow<'a>[src]

Creates a new child window builder with the given ID

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

Replace current window flags with the given value

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

Sets the child window size.

For each independent axis of size:

  • > 0.0: fixed size
  • = 0.0: use remaining host window size
  • < 0.0: use remaining host window size minus abs(size)

pub fn content_size(mut self: 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 focused(mut self: Self, focused: bool) -> Self[src]

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

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

Sets the background color alpha value.

See also draw_background

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

Enables/disables the child window border.

Disabled by default.

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

Enables/disables moving the window when child window is dragged.

Enabled by default.

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

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

Enabled by default.

pub fn scrollable(mut self: 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 always_auto_resize(mut self: Self, value: bool) -> Self[src]

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

Disabled by default.

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

Enables/disables drawing of background color and outside border.

Enabled by default.

pub fn mouse_inputs(mut self: 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(mut self: Self, value: bool) -> Self[src]

Enables/disables the menu bar.

Disabled by default.

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

Enables/disables the horizontal scrollbar.

Disabled by default.

pub fn focus_on_appearing(mut self: 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(mut self: 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(mut self: 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(mut self: 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(mut self: Self, value: bool) -> Self[src]

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

Disabled by default.

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

Enables/disables gamepad/keyboard navigation within the window.

Enabled by default.

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

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

Enabled by default.

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

Disable gamepad/keyboard navigation and focusing.

Shorthand for

.nav_inputs(false)
.nav_focus(false)

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

Don't handle input.

Shorthand for

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

pub fn begin(self, ui: &Ui<'_>) -> Option<ChildWindowToken>[src]

Creates a child window and starts append to it.

Returns Some(ChildWindowToken) 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 child 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> Clone for ChildWindow<'a>[src]

impl<'a> Copy for ChildWindow<'a>[src]

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for ChildWindow<'a>[src]

impl<'a> !Send for ChildWindow<'a>[src]

impl<'a> !Sync for ChildWindow<'a>[src]

impl<'a> Unpin for ChildWindow<'a>[src]

impl<'a> UnwindSafe for ChildWindow<'a>[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.