Enable or disable a button on a list

WTSupported in traditional Synergy on Windows




prev_state = %L_BUTTONSTATE(list_id, name[, new_state])


xcall L_BUTTONSTATE(list_id, name[, new_state])

Return value


On Windows, returns the previous state of the button: D_DISABLED, D_ENABLED, D_INPUTONLY (enabled only within input). (^VAL)

On UNIX, returns the previously specified state (though it has no meaning on UNIX platforms). On OpenVMS, returns true.



The ID of the list. (n)


The name of the button. (a)


(optional) One of the following: D_DISABLED, D_ENABLED, D_INPUTONLY (enabled only within input). (n)


L_BUTTONSTATE enables or disables a button within a list.

If new_state is not specified, the previous state remains unchanged.

You can XCALL this function if you don’t need to know the previous state of the button.


If a button is enabled and the user clicks on it while not in a Toolkit input processing routine, one of two things occurs. Either the click is ignored, or the event will be signaled at the invocation of the next Toolkit input processing routine, depending upon timing. To ensure that the button cannot be pressed when input is not being done to the list, set new_state to D_INPUTONLY.

On UNIX and OpenVMS, this routine is ignored.

See also

Using the button routines for general information on buttons and button sets on windows, tab sets, and lists.


The following example enables the I_OK button whenever we’re performing input on the list.

xcall l_buttonstate(listid, I_OK, D_INPUTONLY)