This is code I've been adding to things for years, it works alright.
It creates buttons with 1 instruction,
then 1 instruction to render the graphics, and 1 for the mouse procedure.
I've used it for 1 or 2 buttons, and even on screen keyboard it worked before.
To make button:
CALL guiaddbutton("button1", "Buttons!!!", 50, 50, 150, 70, 0)
The button name (whatever you want) , the button text (or filename if image is used), x,y,x,y, then 0 or 1, 0 is text button, 1 is image.
CALL guirender
CALL handlemouse
clickname$ will now = the name of the button that was clicked.