mel - interaction - prompt dialog code


/ Published in: Mel
Save to your folder(s)

mel - interaction - prompt dialog code


Copy this code and paste it in your HTML
  1. {
  2. string $text;
  3. // create a prompt dialog to request the users name
  4. string $result = `promptDialog
  5. -title "Hello Window"
  6. -message "Enter Name:"
  7. -button "OK" -button "Cancel"
  8. -defaultButton "OK" -cancelButton "Cancel"
  9. -dismissString "Cancel"`;
  10. // if OK pressed
  11. if ($result == "OK") {
  12. // query the entry typed by the user
  13. $text = `promptDialog -query -text`;
  14. print("HELLO to "+ $text +"\n");
  15. }
  16. else {
  17. print("fine. I won't say hello then :(\n");
  18. }
  19. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.