`User Interface Setup Code
`===========================================
`Call createUI() to setup the user interface
`-------------------------------------------
startBlue "UserID","Key"
`Global Variable Declarations for Gadgets
`----------------------------------------
global Gadget1
global Gadget2
global Gadget3
`Menu Globals
`-----------
global menu
#constant MENU_FILE 0
global menuFile
#constant MENU_EXIT 1
createUI()
while 1
getevent
while eventtype()<>0
if eventsource()=gadget1 and eventtype()=MOUSE_CLICK
Print "You clicked gadget1!!!"
endif
if eventsource()=gadget2 and eventtype()=MOUSE_CLICK
Print "You clicked gadget2!!!"
endif
if eventsource()=gadget3 and eventtype()=MOUSE_CLICK
Print "You clicked gadget3!!!"
endif
getevent
endwhile
rem rest of DBpro code goes here...
endwhile
`Create User Interface
`---------------------
function createUI()
If Not GUI_CONSTANTS Then errorMessage "GUI Constants not defined. Please include gui.dba when you compile" : end
Gadget1=createPanel(50,35,538,368,0)
setPanelBorderStyle Gadget1,2
Gadget2=createButton(197,312,150,35,"Button1.1",0,Gadget1)
Gadget3=createEdit(122,242,315,44,0,Gadget1)
createMainMenu()
endfunction
`Create Main Menu
`----------------
function createMainMenu()
menu=createMenu(0)
addMenuItem menu,"File",0
menuFile=createSubMenu(menu,0)
addMenuItem menuFile,"Exit",1
endfunction
Calling createUI(), within that calling createMainMenu() and the main while loop with the getevent loop are the important parts

.
I hope this helps.
-Xol