Posted to tcl by jima at Mon Oct 03 20:43:28 GMT 2016view raw

  1. package require Tk
  2.  
  3. # Names.
  4. set wToplevel .
  5. set wText .t
  6. set wLabel .l
  7.  
  8. # Title.
  9. wm title $wToplevel "JIMA TKPATH GRAPH"
  10.  
  11. # Maximize.
  12. set screenW [winfo screenwidth $wToplevel]
  13. #~ set screenH [expr {[winfo screenheight $wToplevel]-60}]
  14. #~ wm geometry $wToplevel "${screenW}x${screenH}+0+0"
  15. wm attributes $wToplevel -zoomed 1;# Seems this is unix only.
  16.  
  17. # Exit button.
  18. wm protocol . WM_DELETE_WINDOW {exit}
  19.  
  20. # Widgets.
  21. text $wText -width $screenW -height 1 -bg gray
  22. label $wLabel -width $screenW -height 1 -bg cyan
  23. $wLabel configure -textvariable ::wLabelText
  24.  
  25. # Lay them out
  26. grid $wText -column 0 -row 1 -sticky nsew
  27. grid $wLabel -column 0 -row 2 -sticky nsew
  28.  
  29. # Focus.
  30. focus -force $wText
  31.  
  32. after 1000 {set ::wLabelText WEA}
  33. vwait ::forever
  34.