Posted to tcl by iobates at Fri Jul 24 13:26:31 GMT 2026view raw
- package require Tk
- wm title . Hybrid
- ttk::frame .c -padding "3 3 12 12"
- grid [ttk::button .c.exe -text "Click me" -command execute] -column 1 -row 1 -sticky nsew
- ttk::label .c.lbl -text "Output"
- grid .c -column 0 -row 0 -sticky nsew
- grid .c.lbl -column 1 -row 2 -sticky nsew
- bind . <Return> {execute}
- set output [exec ./hello]
- proc execute {} {
- if {[catch {
- set ::lbl $output
- }]!=0} {
- set ::lbl ""
- }
- }
- vwait forever
Add a comment