Posted By

shiningdev on 03/22/10


Tagged

dialog


Versions (?)

mel - interaction - prompt dialog code


 / Published in: Mel
 

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

mel - interaction - prompt dialog code

  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. }

Report this snippet  

You need to login to post a comment.