Showing posts with label Tcl. Show all posts
Showing posts with label Tcl. Show all posts

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

macOS Sierra: wish (Unix shell): Label and Button

Command:

$ wish


Result:



Command:

% label .x1 -text "Hello World"


Result:

.x1


Command:

% pack .x1


Result:




Command:

% button .b1 -text "Quit" -command { exit }


Result:

.b1


Command:

% pack .b1


Result: