btnwait2

btnwait2 <numerical variable>

This serves as a listener for a button. The result value of the button is returned in the numerical variable.

Return Values:
0: no button was clicked
-1: A right-click occured
>=1: Number of clicked button

Unlike btnwait, this command does not clear any button definitions. Therefore, it will keep reading the button graphic files. Now, since the buttons remain in memory even after there is no use for them, you should call a btndef "" after you're finished using them in order to free up the memory.