Tuesday, October 18, 2016

macOS Sierra: tclsh: Using Tk Package and Adding Label and Button

Command:

$ tclsh
% set label1 "Hello World"


Result:

Hello World


Command:

% set button1 "Quit"


Result:

Quit


Command:

% puts $label1,$button1


Result:

Hello World,Quit


Command:

% package require Tk


Result:

8.5.9



Command:

% label .l -text $label1


Result:

.l


Command:

% button .b -text $button1 -command { exit }


Result:

.b


Command:

% pack .l .b


Result:



Command:

% exit