Here's the code I've got so far, it's close. By moving the sync around I can get either the main window background to show up (Gosub PaintScreen) or I can get the Browser gadget to show up, but not both.
Any help would be appreciated.
while nothing = 0
gosub PaintScreen
if getGadgetVisible(browser) = 1
paintGadget browser
endif
if mouseclick() = 1
if mousex() > 428 and mousex() < 570
if MyError$ = ""
if mousey() > 18 and mousey() < 60
Goto RunGame
endif
endif
if mousey() > 69 and mousey() < 113
Exit
endif
endif
endif
sync
endwhile
[edit]
I'm not entirely sure what I did, but it's working now. Jeez, I hate when that happens..
2 DAYS I SPENT FIGURING THIS OUT!!!!