Computer Science Canada

BASIC GUI.Button program

Author:  Triple Five [ Thu Jan 08, 2004 10:49 am ]
Post subject:  BASIC GUI.Button program

heres a basic GUI program that we did in our grade 10 compsci class

code:
% Creating Buttons in OOT
import GUI in "%oot/lib/GUI"
View.Set("graphics:500;300,nocursor,title:creating buttons")
procedure right
for i:0..100
    drawfilloval(maxx div 2+i,maxy div 2,50,50,5)
    delay(15)
    drawfilloval(maxx div 2+i,maxy div 2,50,50,3)
    end for
    drawfilloval(maxx div 2 + 100, maxy div 2,50,50,5)
    end right
   
    procedure left
    for decreasing i:100..0
    drawfilloval(maxx div 2+i,maxy div 2,50,50,5)
    delay(15)
    drawfilloval(maxx div 2+i, maxy div 2,50,50,3)
    end for
    drawfilloval(maxx div 2,maxy div 2,50,50,5)
    end left
   
    GUI.SetBackgroundColor(3)
    drawfilloval(maxx div 2,maxy div 2,50,50,5)
   
    var button1:int:=GUI.CreateButton(50,150,0,"Move Left",left)
    var button2:int:=GUI.CreateButton(50,200,0,"Move Right",right)
   
    var quitButton:=GUI.CreateButton(400,10,0,"Quit",GUI.Quit)
    loop
    exit when GUI.ProcessEvent
    end loop
    put "Finished"


Very Happy

Author:  Thuged_Out_G [ Thu Jan 08, 2004 3:09 pm ]
Post subject: 

i had to teach myself everything about GUI...we havent learned shit barely in compsci lol

functions/procedures
put/get from a file
records
arrays/2D arrays
loops Laughing
and that is pretty much it, anything else i tought myself...and this is gr.11 compsci Confused

Author:  Maverick [ Thu Jan 08, 2004 3:38 pm ]
Post subject: 

Wow we learned that in like mid Grade 10.

Author:  Triple Five [ Thu Jan 08, 2004 8:07 pm ]
Post subject: 

our teacher is preaty good with turing stuff! if we want to learn someing that not in the program he'll print off a sheet for us about the program and teach us the code and explain it to us! Very Happy

Author:  shorthair [ Tue Jan 13, 2004 7:12 pm ]
Post subject: 

our teacher apparently made the payroll system for the big-B , it was a 180 program PROGRAM, hes a really good teacher , and we take part in all the contests and usually make it to toronto

Author:  kalin [ Wed Jan 21, 2004 5:08 pm ]
Post subject: 

thats a cool program. should make it so that you can shoot it or something...make a game out of it


: