Show / Hide Table of Contents

Struct ImCollapsibleArea

Convenience struct to conveniently create a collapsible scope.

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: InitialPrefabs.NimGui
Assembly: InitialPrefabs.ImGui.dll
Syntax
public ref struct ImCollapsibleArea

Constructors

ImCollapsibleArea(String)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(string label)
Parameters
Type Name Description
System.String label

The label for the clickable button.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible")) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(String, in ImButtonStyle)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(string label, in ImButtonStyle style)
Parameters
Type Name Description
System.String label

The label for the clickable button.

ImButtonStyle style

A custom button style for the collapsible area.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible")) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(String, Boolean)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(string label, bool isInitiallyCollapsed)
Parameters
Type Name Description
System.String label

The StringBuilder containing the label for the clickable button.

System.Boolean isInitiallyCollapsed

Do you want the area collapsed.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible", true)) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(String, Boolean, in ImButtonStyle)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(string label, bool isInitiallyCollapsed, in ImButtonStyle style)
Parameters
Type Name Description
System.String label

The StringBuilder containing the label for the clickable button.

System.Boolean isInitiallyCollapsed

Do you want the area collapsed.

ImButtonStyle style

A custom button style.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible", true)) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(StringBuilder)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(StringBuilder builder)
Parameters
Type Name Description
System.Text.StringBuilder builder

The builder containing the label for the clickable button.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible")) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(StringBuilder, in ImButtonStyle)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(StringBuilder builder, in ImButtonStyle style)
Parameters
Type Name Description
System.Text.StringBuilder builder

The builder containing the label for the clickable button.

ImButtonStyle style

A custom button style.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible")) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(StringBuilder, Boolean)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(StringBuilder builder, bool isInitiallyCollapsed)
Parameters
Type Name Description
System.Text.StringBuilder builder

The builder containing the label for the clickable button.

System.Boolean isInitiallyCollapsed

Do you want the area collapsed.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible", true)) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

ImCollapsibleArea(StringBuilder, Boolean, in ImButtonStyle)

Stack only struct to call BeginCollapsible in a scope similar to ImPane.

Declaration
public ImCollapsibleArea(StringBuilder builder, bool isInitiallyCollapsed, in ImButtonStyle style)
Parameters
Type Name Description
System.Text.StringBuilder builder

The builder containing the label for the clickable button.

System.Boolean isInitiallyCollapsed

Do you want the area collapsed.

ImButtonStyle style

A custom button style.

Remarks

This should be used with the Dispose pattern.

Examples

How to use the Dispose pattern.

using (ImCollapsibleArea area = new ImCollapsible("Collapsible", true)) {
    if (area.IsVisible) {
        // Draw more logic here.
    }
}

Fields

IsVisible

Use this property to determine whether or not you should draw widgets.

Declaration
public readonly bool IsVisible
Field Value
Type Description
System.Boolean

Methods

Dispose()

Declaration
public void Dispose()
In This Article
Back to top Generated by DocFX