Return to Snippet

Revision: 25161
at March 22, 2010 06:18 by shiningdev


Initial Code
{
    string $text;
    // create a prompt dialog to request the users name
    string $result = `promptDialog
    -title "Hello Window"
    -message "Enter Name:"
    -button "OK" -button "Cancel"
    -defaultButton "OK" -cancelButton "Cancel"
    -dismissString "Cancel"`;
    // if OK pressed
    if ($result == "OK") {
        // query the entry typed by the user
        $text = `promptDialog -query -text`;
        print("HELLO to "+ $text +"\n");
    }
    else {
        print("fine. I won't say hello then :(\n");
    }
}

Initial URL
http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/mel/GUI_dialogs.html

Initial Description
mel - interaction - prompt dialog code

Initial Title
mel - interaction - prompt dialog code

Initial Tags


Initial Language
Mel