Computer Science Canada checkboxes question |
Author: | Fiend-Master [ Sat Jan 29, 2005 3:39 pm ] |
Post subject: | checkboxes question |
with checkboxes, is it possible to create a checkbox, and make it so that it is already checked? or, is it possible to to refresh a certain checkbox so that i can set it to "checked" depending on settings? I am asking because i am making a program, and based on user-saved settings, I need some checkboxes to be checked, while others to be blank when the checkboxes appear on the screen. any help would be appreciated, thanks in advance |
Author: | person [ Sat Jan 29, 2005 4:05 pm ] |
Post subject: | |
its in turing help (the F10 one not the compsci one) |
Author: | person [ Sat Jan 29, 2005 4:08 pm ] |
Post subject: | |
btw if u cant find it here it is Quote: % The "GUI.CreateCheckBoxFull" program. import GUI procedure DoNothing (status : boolean) end DoNothing View.Set ("graphics:300;100,nobuttonbar") var cb1 : int := GUI.CreateCheckBox (10, 10, "Check Box 1", DoNothing) var cb2 : int := GUI.CreateCheckBoxFull (200, 10, "Check Box 2", DoNothing, GUI.RIGHT, '2') GUI.SetCheckBox (cb2, true) var quitBtn : int := GUI.CreateButton (230, 10, 0, "Quit", GUI.Quit) loop exit when GUI.ProcessEvent end loop var cb1Status : boolean := GUI.GetCheckBox (cb1) var cb2Status : boolean := GUI.GetCheckBox (cb2) if cb1Status then put "Check box 1: filled" else put "Check box 1: empty" end if if cb2Status then put "Check box 2: filled" else put "Check box 2: empty" end if remember to use "createbuttonfull" EDIT: createbuttonfull = createcheckboxfull |
Author: | Delos [ Sat Jan 29, 2005 6:22 pm ] |
Post subject: | |
Methinks you mean "CreateCheckboxFull" (or however it's spelt). Also, I have a nagging suspiscion that "GUI.SetCheckBox (cb2, true)" will set the status of the checkbox. |