Guest User

Untitled

a guest
Oct 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #! /bin/env tclsh
  2. package require Tk
  3. # Create the main message window
  4. message .m -text {Hello Tcl!} -background white
  5. pack .m -expand true -fill both -ipadx 100 -ipady 40
  6.  
  7. # Create the main menu bar with a Help-About entry
  8. menu .menubar
  9. menu .menubar.help -tearoff 0
  10. .menubar add cascade -label Help -menu .menubar.help -underline 0
  11. .menubar.help add command -label {About Hello ...} \
  12. -accelerator F1 -underline 0 -command showAbout
  13.  
  14. # Define a procedure - an action for Help-About
  15. proc showAbout {} {
  16. tk_messageBox -message "Tcl/Tk\nHello Windows\nVersion 1.0" \
  17. -title {About Hello}
  18. }
  19.  
  20. # Configure the main window
  21. wm title . {Hello Foundation Application}
  22. . configure -menu .menubar -width 200 -height 150
  23. bind . {<Key F1>} {showAbout}
Add Comment
Please, Sign In to add comment