Contents Previous Next Subchapters

Easy Dialog Caption and Button Arguments
Syntax easydlg(captionbuttons)
See Also adddialog , pushbutton

Caption
The caption argument is a character row vector that specifies the caption for the dialog and the name of the call back function that is called when the dialog is dismissed. The dialog caption includes all the characters up to but not including the first under bar in caption. The call back function name includes all the characters in caption but characters other than letters and decimal digits are converted to under bars. (If the first character in caption is a decimal digit, it is also converted to an under bar.)

Buttons
The buttons argument is a character matrix with each row specifying the name of a button within the dialog. The dialog is dismissed and the call back function is called when any button within the dialog is selected (see easydlg(options) for an exception to this rule). The call back function has one argument which is set equal to the name of the button that is chosen.

Program
     clear
     caption = "Buttons_callback"
     buttons = {"Ok", "Cancel"}
     easydlg(caption, buttons)
     function Buttons_callback(button) begin
          print "button =", button
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
If you then select the Cancel button, the function Buttons_callback will be called and it will print the text
     button = Cancel
in the Command window.