
-----------------------------------
kk
Sat Jan 10, 2004 5:31 pm

GUI looping
-----------------------------------
I have to make an email program and i'm currently working on the login screen with GUi that opens in a new window.  can you use loops in gui ? because the problem is that i have a "login" button hat the user clicks to login and its action proc checks if the username and passwrod is correct.  the action proc is before the commands declaring the gui buttons and text fields in hte program.  If the name and password are incorrect, i want to "loop" the whole process again, but i don't see any way to do this since the gui commands are after the action procedure. 

Also.. can you have 
loop
exit when GUI.ProcessEvent
end loop
multiple times in your program?  does there have to be some sort of order as to where you put it, or can you just have your whole program and stick that event loop at the very end?

Here's the program:

var username : string
var password : string
var NAME, PASS : boolean

var LoginWin : int
var loginname : int
var loginpass : int
var namelbl, passlbl : int
var loginB : int %login button

%checks input is under specific lenth
fcn lngth_iput2 (word : string, lenth : int) : boolean
    if length (word) 10 then
        drawfillbox (3, 20, 350, 35, white)
        GUI.SetActive (loginpass)
    else
        Font.Draw ("Your username must be no longer than 10 characters", 10, 20, font1, black)
        GUI.SetText (loginname, "")
    end if
end namme

proc passs (text : string)
    password := GUI.GetText (loginpass)
    put password
    if lngth_iput2 (password, 9) then  %if password 