when is this event called? events.on_gui_selection_state_changed
Posted: Sun Jan 21, 2024 6:49 pm
I have a little mod, with its GUI. On the GUI I have a drop-down list, and I'd like to do some actions whenever the user selects another item from the list.
I have registered a handler for the events.on_gui_selection_state_changed which I believe should be the event I need, but when debugging (I've placed a breakpoint in the function called by the trigger) nothing happens as if the event is not triggered.
example of the handler
The only event that gets triggered is when I click on the drop-down list (with event.on_gui_clik) but that only gets me the actual element in the list that is selected at the moment I've clicked, not the element that I'm changing to. I hope this makes sense.
Does any good soul know how this works or which event I can try out to get what I want (is it even possible?)
I have registered a handler for the events.on_gui_selection_state_changed which I believe should be the event I need, but when debugging (I've placed a breakpoint in the function called by the trigger) nothing happens as if the event is not triggered.
example of the handler
Code: Select all
script.on_event(defines.events.on_gui_selection_state_changed, function(event)
game.print(event.element.name)
end)
Does any good soul know how this works or which event I can try out to get what I want (is it even possible?)