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

Username:   Password: 
 RegisterRegister   
 How To Do Buttons??
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KLT_27




PostPosted: Tue Jan 20, 2004 11:56 am   Post subject: How To Do Buttons??

Hey everyone I'm obviously a newbe but I was wondering if i could get help on GUI button making. I'm not sure how to do them and I really need help. If anyone could help that would be so so great Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Jan 20, 2004 8:34 pm   Post subject: (No subject)

if you have the new turing update (4.0.5) they added a tutorial on the turing GUI in the docmuamtaion. also i bivle there is info in some of the older turing 4 verson on the GUI with examples.

the basicks are you need a loop like this to run while you whont the buttions to work

code:

loop
    exit when GUI.ProcessEvent
end loop


and each buttion needs a procedure to go to when cliked.


ex code from turing doc:
code:

% The "Hello" program.
import GUI

View.Set ("graphics:200;200") % Shrink the run window

% The procedure called when the button is pushed.
procedure PutHello
    put "Hello"
end PutHello

% Create the button. The number returned is the ID number of the button.
var b : int := GUI.CreateButton (100, 100, 0, "Say Hello", PutHello)

% Now process events until the user aborts the program.
loop
    exit when GUI.ProcessEvent
end loop


you need to import the GUI b/c it is not inculed in the ruing coamnds by deufalt.

the comand to make a buttion gose like this:

GUI.CreateButton (x, y, width : int, text : string, actionProc : procedure x ()) : int
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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: