Click or drag to resize

GUILayoutButtonsPush Method

Makes a button that fires a callback when pressed or released.

Namespace:  KSPDev.GUIUtils
Assembly:  KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
Syntax
C#
public static bool Push(
	bool btnState,
	GUIContent guiCnt,
	GUIStyle style,
	GUILayoutOption[] options,
	Action fnPush,
	Action fnRelease,
	GuiActionsList actionsList = null
)
Request Example View Source

Parameters

btnState
Type: SystemBoolean
The current press state of the button.
guiCnt
Type: GUIContent
The GUI content to present as the button's caption.
style
Type: GUIStyle
The GUI style of the control.
options
Type: GUILayoutOption
The GUILayout options to apply to the control. It can be null.
fnPush
Type: SystemAction
The callback to call when the button is pressed. Can be null.
fnRelease
Type: SystemAction
The callback to call when the button is released. Can be null.
actionsList (Optional)
Type: KSPDev.GUIUtilsGuiActionsList
The action list to execute the callbacks thru. If the list is omitted, then the callback is fired right away. Otherwise, it's added to the list and executed when the list is triggered.

Return Value

Type: Boolean
The new button press state.
Remarks
The callbacks are only fired once for every state change, and are guarnteed to not be called during the layout phase. The callback is called *after* the state is updated.
See Also