Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 GUI.CreateTextField help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
surfed




PostPosted: Tue May 31, 2005 12:37 pm   Post subject: GUI.CreateTextField help

code:
    locatexy (250, 160)
    var alias : int
    var name : string

    put "Name:"

    alias := GUI.CreateTextFieldFull (300, 160, 100, "", difficulty, GUI.INDENT, 0, 0)

    name := GUI.GetText (alias)

GUI.Dispose (alias)



1) What i am trying to do is store the word that is typed in the "alias" text field into variable "name".
2) After it stores the name, i want it to get rid of the text field GUI. GUI.Dispose doesn't seem to work because when i go to the next screen and cls, the textfield can still be editted..
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Tue May 31, 2005 1:33 pm   Post subject: (No subject)

Did you use Gui.ProcessEvent in a loop? Because other than that your code seems to work. Here's what I got from it.
code:

import GUI
locatexy (250, 160)
var alias : int
var name : string
put "Name:"
proc difficulty (q : string)
    name := q
end difficulty
alias := GUI.CreateTextFieldFull (300, 160, 100, "", difficulty, GUI.INDENT, 0, 0)
var x, y, z : int
loop
    mousewhere (x, y, z)
    exit when GUI.ProcessEvent or z = 1
end loop
GUI.Dispose (alias)
cls %Screen's cleared
locatexy (250, 160)
put "Name: ", name

surfed




PostPosted: Tue May 31, 2005 4:43 pm   Post subject: (No subject)

Thanks ^^, i have another question:

code:
loop
    mousewhere (x, y, z)
    exit when GUI.ProcessEvent or z = 1
end loop


When does it process an event? I have to click a place for it to stop, so if i want it to exit when i press enter, then i use the Input.Keydown command?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: