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

Username:   Password: 
 RegisterRegister   
 textfields within a procedure
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Naveg




PostPosted: Wed Feb 23, 2005 9:47 pm   Post subject: textfields within a procedure

How come textfields don't work in a procedure without an added processEvent inside? is there a way around this? example:

code:
procedure addItem
    cls
    counter := counter + 1
    new itemNames, (upper (itemNames) + 1)
    new itemPrices, (upper (itemPrices) + 1)
    ok := GUI.CreateButton (50, 200, 50, "OK", addItemScreen)
    nameField := GUI.CreateTextField (50, 350, 100, "", doNothing)
    nameLabel := GUI.CreateLabel (10, 350, "Name")
    priceField := GUI.CreateTextField (50, 300, 100, "", doNothing)
    priceLabel := GUI.CreateLabel (10, 300, "Price")
    priceReal := strreal (GUI.GetText (priceField))
    itemNames (upper (itemNames)) := GUI.GetText (nameField)
    itemPrices (upper (itemPrices)) := priceReal
end addItem


i need to be able to input text into the fields
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Feb 24, 2005 11:04 am   Post subject: (No subject)

the way GUI class works is that processEvent() needs to be called to check if any of user actions interact with any of GUI elements.

in theory, you build up your GUI and then let the program run in an infinate loop

Turing:

loop
exit when GUI.processEvent()
end loop
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  [ 2 Posts ]
Jump to:   


Style:  
Search: