
-----------------------------------
kirsty_16
Wed Jan 14, 2004 1:22 pm

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

-----------------------------------
Tony
Wed Jan 14, 2004 6:51 pm


-----------------------------------
if you dont like using GUI, you can use Mouse.Where and check if user clicks inside the box yourself

-----------------------------------
kanetix
Thu Jan 15, 2004 8:36 pm


-----------------------------------
for mousewhere(x,y, _) 