Try this:
Write a simple menu function that allows you to more or less control the options, header, etc. Do this in a singly function,eg
FUNCTION PopUpMenu(Items$, Header$, SizeX, SizeY)
` Place your menu in here. Each option has a number.
` The option selected's number is assigned to ReturnValue. The value is returned....
ENDFUNCTION ReturnValue
`That way, you can say:
`choice = PopUpMenu("Coffee,Tea", "What do you wannna drink?", 400, 400)
`IF choice = 1: [etc, etc]: ENDIF
If you need me to elaborate, I'll try to dig up some old code tomorrow. Hopefully this will help, or at least something to look at, for the mean time.
EDIT: As promised I dug up some old code... But it was filled with dependencies on other things in my program. So I wrote you a very BASIC example. This should give you the gist of it. You can elaborate on this, expand it, whatever. Anyway, here is teh codez:
`Set display to your desired size. I used 800x600 coz its very compatible
SET DISPLAY MODE 800, 600, 32
`Here we call the MsgBox function
ch = MsgBox("Goodbye World!")
`This will print the outcome
IF ch = 1: txt$ = "OK": ENDIF
IF ch = 0: txt$ = "Cancel": ENDIF
WHILE SCANCODE() < 1
SET CURSOR 0, 0
PRINT "Your choice number was: " + STR$(ch) + " - " + txt$
PRINT " "
PRINT "With this, you can perform condition-based actions"
PRINT "in your program!"
PRINT " "
PRINT "Press any key to end..."
ENDWHILE
END
Function MsgBox(msg$)
`This is a basic OK/Cancel box. Use this to expand upon.
`It's a good idea to set a default return value for debugging and, in other scenarios, returning a
`value seperate from your typical range (such as a realtime menu)
Choice = -1
`Now we draw this. First we create a canvas
CREATE BITMAP 30, 400, 300
SET CURRENT BITMAP 30
`After making the canvas, we draw to it. We'll start with a basic white box.
INK RGB(255,255,255), RGB(255,255,255)
BOX 0, 0, 400, 300
`Now we draw a slightly smaller box inside to create a border from the first.
INK RGB(150,150,250), RGB(0,0,0)
BOX 2, 2, 398, 298
`Next, we create the buttons. I'll making them plain red blocks as this is just an example.
INK RGB(200,100,100), RGB(0,0,0)
BOX 50, 250, 150, 280
BOX 250, 250, 350, 280
`Next we place the text
INK RGB(255,255,255), RGB(0,0,0)
`CENTRE TEXT actually centers the text around a point, not the screen.
CENTER TEXT 200, 30, msg$
`We know the default font is 8x16px. We know that the buttons start at 250y. So (16/2) + 250 = 258.
`Our box's x-position is from 50 - 150. That means the halfway point is 100.
CENTER TEXT 100, 258, "OK"
CENTER TEXT 300, 258, "Cancel"
`Finally, grab the image
GET IMAGE 999, 0, 0, 400, 300, 1
`Now we set drawing off our canvas and back to the screen.
SET CURRENT BITMAP 0
`Finally, delete the unused canvas.
DELETE BITMAP 30
`And now we can sprite our window.
`I'm using the screen as a centering point but you can align it to anything really.
WinX = (SCREEN WIDTH() / 2) - 200
WinY = (SCREEN HEIGHT() / 2) - 150
SPRITE 999, WinX, WinY, 999
`Drawing done!
`Here's our main loop
DO
`If the left mouse button gets clicked, start checking where the cursor is
IF MOUSECLICK() = 1
`If the cursor is within y-bounds, check to see if it is within one of our buttons' xp-bounds
IF MOUSEY() > WinY + 249 AND MOUSEY() < WinY + 281
`If so, assign the relevant return value to our Choice variable and EXIT the loop.
IF MOUSEX() > WinX + 49 AND MOUSEX() < WinX + 151: Choice = 1: EXIT: ENDIF
IF MOUSEX() > WinX + 249 AND MOUSEX() < WinX + 351: Choice = 0: EXIT: ENDIF
ENDIF
ENDIF
LOOP
`Finally, if the loop is exitted, the Choice is returned
EndFunction Choice