Skip to content

RowHandle

classclient onlysince 0.1.0

com.galdurstudio.galdurui.api.window.RowHandle

Handle to a row of a GaldurWindow: elements placed side by side, left to right, instead of stacked.

Returned by GaldurWindow.addRow(). Elements are added as in the window, and each returns its own handle. The elements of a row are centred vertically on each other and separated by the theme gap (spacing.gap).

Example.java
RowHandle actions = window.addRow(true);actions.addButton(Component.literal("Confirm"), this::confirm);actions.addButton(Component.literal("Cancel"), window::close);

Like any ElementHandle, the row can be disabled, hidden or given a tooltip all at once:

  • disabled, it disables all its elements;
  • hidden, it disappears with its elements and frees its space; a row whose elements are all hidden frees its space too;
  • its tooltip shows on the elements that have none of their own (including in place of an icon button's label).

An element added while the window is shown appears on the next frame. Call on the client thread. A row does not contain another row.

public class RowHandle extends ElementHandle
PACKAGEapi.window
SIDEclient only

MEMBERS · 11

Methods 10

addText

public ElementHandle addText(Component text)

Adds a text at the end of the row.

PARAMETERS

textComponentthe text to show

RETURNSElementHandle — the element's handle (disable, hide, tooltip)

addButton

public ElementHandle addButton(Component label, Runnable action)

Adds a button at the end of the row.

PARAMETERS

labelComponentthe button label
actionRunnablerun when the button is activated, by mouse or keyboard

RETURNSElementHandle — the element's handle (disable, hide, tooltip)

addIconButton

2 overloads
public ElementHandle addIconButton(ItemStack icon, Component label, Runnable action)
public ElementHandle addIconButton(ResourceLocation sprite, Component label, Runnable action)

Adds an icon button showing an item at the end of the row.

PARAMETERS

iconItemStackthe shown item; copied
labelComponenttooltip and narration text (not drawn on the button)
actionRunnablerun when the button is activated, by mouse or keyboard
spriteResourceLocationsprite id in the GUI atlas, in grayscale

RETURNSElementHandle — the element's handle (disable, hide, tooltip)

addCheckbox

public CheckboxHandle addCheckbox(Component label, boolean defaultState)

Adds a checkbox at the end of the row and returns its handle.

PARAMETERS

labelComponentthe text next to the box
defaultStatebooleantrue if the checkbox is checked on open

RETURNSCheckboxHandle — the checkbox handle

public void setEnabled(boolean enabled)

Enables or disables the element. No effect if it is already in that state.

PARAMETERS

enabledbooleanfalse to disable it
public boolean isEnabled()

RETURNSboolean — true if the element is enabled (the default)

public void setVisible(boolean visible)

Shows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.

PARAMETERS

visiblebooleanfalse to hide it
public boolean isVisible()

RETURNSboolean — true if the element is shown (the default)

public void setTooltip(Component tooltip)

Sets the text shown when the element is hovered.

PARAMETERS

tooltipComponentthe tooltip text, or null to remove it
public Component getTooltip()

RETURNSComponent — the tooltip text, or null if none

© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyNot an official Minecraft product. Not approved by or associated with Mojang or Microsoft.