Computer Science Canada GUI Help |
Author: | turinggirl [ Sun May 13, 2012 11:44 am ] | ||
Post subject: | GUI Help | ||
What is it you are trying to achieve? <Replace all the <> with your answers/code and remove the <>> What is the problem you are having? How can I carry out the sum on one window to another window using GUI? Here is part of my program: procedure windowBCheckout GUI.HideWindow (defWinID) GUI.ShowWindow (WindowBCheckout) end windowBCheckout count:int:=0 procedure windowtouch count := count + 199 put count end windowtouch buttontouch := GUI.CreateButton (765, 350, 0, "Add to Cart", windowtouch) in another window: windowtouch %but this gives me 0 instead of 199 Let say I have a bunch of calculations on one window, how would I carry out the sum to another window? It's really difficult to explain on this website S: Describe what you have tried to solve this problem <Answer Here> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using <Answer Here> |
Author: | Insectoid [ Sun May 13, 2012 12:53 pm ] | ||
Post subject: | RE:GUI Help | ||
You switch between windows using their IDs. Each window (except the default) should be bound to a variable (window1, window2, whatever). The default window has a static ID (though I forget what it is). There's a Window.setActive() command (or something like that) where you pass the window you want to use as the active window. All screen output will go to this screen. Then you can switch back as necessary.
The default window (the one that pops up automatically when you draw/put something) has a specific ID (probably 1) that you can pass to the setActive function (so you would call Window.setActive(1) to activate the default window). |
Author: | evildaddy911 [ Sun May 13, 2012 2:16 pm ] |
Post subject: | RE:GUI Help |
the default window's constant is defWinID which = -1 |