ice.guiswapper

Swaps GUI subtrees connected to a single SlotWidget.

class GUISwapper;

Swaps GUI subtrees connected to a single SlotWidget.

Used to organize the ICE main menu.

this(SlotWidget parentSlot);

Construct a GUISwapper connecting GUI subtrees to specified SlotWidget.

void addGUI(SwappableGUI gui, const string name);

Add a swappable GUI with specified name.

void removeGUI(const string name);

Add a swappable GUI with specified name. A GUI with this name must be in the swapper.

void setGUI(string name);

Forcibly connect GUI with specified name.

Can only be used when no GUI is connected, or to disconnect(null) a connected GUI.

const pure nothrow @property string currentGUIName();

Return name of the currently set GUI.

abstract class SwappableGUI;

Parent class for swappable GUI subtrees.

protected void delegate(string) swapGUI_;

Swaps this GUI (connected at call) with GUI specified by a name string.

protected final pure nothrow @property @safe void rootWidget(RootWidget rootWidget);

Set the root widget. Can be called more than once.

this(RootWidget rootWidget);

Initialize a SwappableGUI with a root widget.

class PlainSwappableGUI: ice.guiswapper.SwappableGUI;

Wraps any RootWidget in a SwappableGUI, without any extra logic.

this(RootWidget root);

Constructs the PlainSwappableGUI.

Parameters:
RootWidget root RootWidget to wrap.