HyUI icon indicating copy to clipboard operation
HyUI copied to clipboard

`UIEventBuilder` not exposed in `editElement`

Open SelfMadeSystem opened this issue 9 months ago • 1 comments

I want to load UI from a .ui file and the docs say

Elements defined within the .ui file cannot have event listeners attached to them via .addEventListener. This method is only for elements created via the Java Builder API or HYUIML. To interact with elements in a .ui file, use .editElement to send raw UI commands.

However, to add events to a button, I require access to the UIEventBuilder which is not exposed to .editElement. Easy fix would be to add an overload to .editElement that accepts a BiConsumer<UICommandBuilder, UIEventBuilder>.

If there is another way to do this, please update the docs.

SelfMadeSystem avatar Feb 06 '26 00:02 SelfMadeSystem

Fixed in 0.7.1 - release pending.

Elliesaur avatar Feb 06 '26 08:02 Elliesaur