Posted to tcl by iobates at Fri Jul 24 13:26:31 GMT 2026view raw

  1. package require Tk
  2.  
  3. wm title . Hybrid
  4.  
  5. ttk::frame .c -padding "3 3 12 12"
  6. grid [ttk::button .c.exe -text "Click me" -command execute] -column 1 -row 1 -sticky nsew
  7. ttk::label .c.lbl -text "Output"
  8.  
  9. grid .c -column 0 -row 0 -sticky nsew
  10.  
  11. grid .c.lbl -column 1 -row 2 -sticky nsew
  12.  
  13. bind . <Return> {execute}
  14.  
  15. set output [exec ./hello]
  16.  
  17. proc execute {} {
  18. if {[catch {
  19. set ::lbl $output
  20. }]!=0} {
  21. set ::lbl ""
  22. }
  23. }
  24.  
  25. vwait forever
  26.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week