[][src]Struct gdnative::api::TabContainer

pub struct TabContainer { /* fields omitted */ }

core class TabContainer inherits Container (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

Non reference counted objects such as the ones of this type are usually owned by the engine.

TabContainer is a reference-only type. Persistent references can only exist in the unsafe Ref<TabContainer> form.

In the cases where Rust code owns an object of this type, for example if the object was just created on the Rust side and not passed to the engine yet, ownership should be either given to the engine or the object must be manually destroyed using Ref::free, or Ref::queue_free if it is a Node.

Class hierarchy

TabContainer inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl TabContainer[src]

Constants

impl TabContainer[src]

pub fn new() -> Ref<TabContainer, Unique>[src]

Creates a new instance of this object.

Because this type is not reference counted, the lifetime of the returned object is not automatically managed.

Immediately after creation, the object is owned by the caller, and can be passed to the engine (in which case the engine will be responsible for destroying the object) or destroyed manually using Ref::free, or preferably Ref::queue_free if it is a Node.

pub fn are_tabs_visible(&self) -> bool[src]

If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden.

pub fn current_tab(&self) -> i64[src]

The current tab index. When set, this index's [Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code].

pub fn get_current_tab_control(&self) -> Option<Ref<Control, Shared>>[src]

Returns the child [Control] node located at the active tab index.

pub fn drag_to_rearrange_enabled(&self) -> bool[src]

If [code]true[/code], tabs can be rearranged with mouse drag.

pub fn get_popup(&self) -> Option<Ref<Popup, Shared>>[src]

Returns the [Popup] node instance if one has been set already with [method set_popup].

pub fn get_previous_tab(&self) -> i64[src]

Returns the previously active tab index.

pub fn tab_align(&self) -> TabAlign[src]

The alignment of all tabs in the tab container. See the [enum TabAlign] constants for details.

pub fn get_tab_control(&self, tab_idx: i64) -> Option<Ref<Control, Shared>>[src]

Returns the [Control] node from the tab at index [code]tab_idx[/code].

pub fn get_tab_count(&self) -> i64[src]

Returns the number of tabs.

pub fn get_tab_disabled(&self, tab_idx: i64) -> bool[src]

Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled.

pub fn get_tab_icon(&self, tab_idx: i64) -> Option<Ref<Texture, Shared>>[src]

Returns the [Texture] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture].

pub fn get_tab_title(&self, tab_idx: i64) -> GodotString[src]

Returns the title of the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title].

pub fn get_tabs_rearrange_group(&self) -> i64[src]

Returns the [TabContainer] rearrange group id.

pub fn use_hidden_tabs_for_min_size(&self) -> bool[src]

If [code]true[/code], children [Control] nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.

pub fn set_current_tab(&self, tab_idx: i64)[src]

The current tab index. When set, this index's [Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code].

pub fn set_drag_to_rearrange_enabled(&self, enabled: bool)[src]

If [code]true[/code], tabs can be rearranged with mouse drag.

pub fn set_popup(&self, popup: impl AsArg<Node>)[src]

If set on a [Popup] node instance, a popup menu icon appears in the top-right corner of the [TabContainer]. Clicking it will expand the [Popup] node.

pub fn set_tab_align(&self, align: i64)[src]

The alignment of all tabs in the tab container. See the [enum TabAlign] constants for details.

pub fn set_tab_disabled(&self, tab_idx: i64, disabled: bool)[src]

If [code]disabled[/code] is [code]false[/code], hides the tab at index [code]tab_idx[/code].
				[b]Note:[/b] Its title text will remain, unless also removed with [method set_tab_title].

pub fn set_tab_icon(&self, tab_idx: i64, icon: impl AsArg<Texture>)[src]

Sets an icon for the tab at index [code]tab_idx[/code].

pub fn set_tab_title(&self, tab_idx: i64, title: impl Into<GodotString>)[src]

Sets a title for the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title].

pub fn set_tabs_rearrange_group(&self, group_id: i64)[src]

Defines rearrange group id, choose for each [TabContainer] the same value to enable tab drag between [TabContainer]. Enable drag with [code]set_drag_to_rearrange_enabled(true)[/code].

pub fn set_tabs_visible(&self, visible: bool)[src]

If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden.

pub fn set_use_hidden_tabs_for_min_size(&self, enabled: bool)[src]

If [code]true[/code], children [Control] nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.

Methods from Deref<Target = Container>

pub fn fit_child_in_rect(
    &self,
    child: impl AsArg<Control>,
    rect: Rect<f32, UnknownUnit>
)
[src]

Fit a child control in a given rect. This is mainly a helper for creating custom container classes.

pub fn queue_sort(&self)[src]

Queue resort of the contained children. This is called automatically anyway, but can be called upon request.

Trait Implementations

impl Debug for TabContainer[src]

impl Deref for TabContainer[src]

type Target = Container

The resulting type after dereferencing.

impl DerefMut for TabContainer[src]

impl GodotObject for TabContainer[src]

type RefKind = ManuallyManaged

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Instanciable for TabContainer[src]

impl QueueFree for TabContainer[src]

impl SubClass<CanvasItem> for TabContainer[src]

impl SubClass<Container> for TabContainer[src]

impl SubClass<Control> for TabContainer[src]

impl SubClass<Node> for TabContainer[src]

impl SubClass<Object> for TabContainer[src]

Auto Trait Implementations

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> SubClass<T> for T where
    T: GodotObject
[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.