Computer Science Canada button problem 2 |
Author: | kirsty_16 [ Wed Jan 14, 2004 1:22 pm ] |
Post subject: | button problem 2 |
This what I have so far. This is my first time with buttons. I usually try to avoid them but this time i couldn't. Is there any easier way of doing this?? here it is... import GUI in "%oot/lib/GUI" proc choice_A locate (2,3) put "You chose 'Planets'" end choice_A proc choice_B locate (2, 3) put "You chose 'Time'" end choice_B proc choice_C locate (2, 3) put "You chose 'Disasters'" end choice_C proc choice_D locate (2, 3) put "You chose 'Bands'" end choice_D proc makethebuttons var button1 : int := GUI.CreateButton (90, 700, 150, "A", choice_A) var button2 : int := GUI.CreateButton (90, 650, 130, "B", choice_B) var button3 : int := GUI.CreateButton (90, 600, 110, "C", choice_C) var button4 : int := GUI.CreateButton (90, 550, 90, "D", choice_D) var button7 : int := GUI.CreateButton (90, 500, 70, "Quit", GUI.Quit) end makethebuttons procedure main locate (3, 5) put " " put "" makethebuttons end main main loop exit when GUI.ProcessEvent end loop |
Author: | Tony [ Wed Jan 14, 2004 6:51 pm ] |
Post subject: | |
if you dont like using GUI, you can use Mouse.Where and check if user clicks inside the box yourself |
Author: | kanetix [ Thu Jan 15, 2004 8:36 pm ] |
Post subject: | |
for mousewhere(x,y, _) <-- what is the third value? |
Author: | Neja [ Thu Jan 15, 2004 11:59 pm ] |
Post subject: | |
The third value is button (button=1 when the button is being pressed) |
Author: | BryX [ Fri Jan 16, 2004 3:25 pm ] | ||
Post subject: | |||
there is an easier way, the way i did it was this....this way u don't have to ahve seperate procedures for each answer, u can use the same ones for every question
|