Skip to content

pyux.set_timer_handler

fabian-flassig edited this page Apr 14, 2026 · 5 revisions

Sets the timer handler for timer events in the graphics area.

pyux.set_timer_handler(function[, id])

Parameters

Type Description
function function A lua function that is invoked when the timer event occurs. nil will remove the handler.
id integer Optional timer id. Default is 0.

Callback

The parameters to the handler function are as follows:

function on_timer_handler(info)
Type Description
info {...} A table containing the following key-value pairs:
info.timer_id integer The id of the timer.
info.tick integer Number of timer ticks since the timer was started.

Note:

This handler is specific to the current modal environment / dialog and can only be set within a dialog.

Use pyux.start_timer to start the timer.

Version requirements

This function is available in V26 and above.

See also

pyux, start_timer, set_on_left_click_handler

Clone this wiki locally