Contents Previous Next Subchapters

Easy Dialog Check Box Fields
Syntax easydlg(captionbuttonsmessagelayout)
See Also checkbox

Description
If a field type in the layout argument is "checkbox", the corresponding field setting the field setting is the initial value for the field. It can be either "true" or "false" depending on whether the box has a check or not. If the user selects the check box, the value of this field will change.

Program
     clear
     caption = "Checkbox_callback"
     buttons = {"Ok", "Cancel"}
     message = "Save program as the specified file."
     layout = { ...
          "label, File:, 15, lib\easydlg.mat", ...
          "checkbox, Binary, 2, false" ...
     }
     easydlg(caption, buttons, message, layout)
     function Checkbox_callback(button) begin
          print "button =", button
          print "Binary =", easydlg("Binary")
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
If you select the check box so that it is checked, and then select the Ok button, the function Checkbox_callback will be called and it will print the text
     button = Ok
     Binary = true
in the Command window.