#!/bin/sh
# simpl_brrn.tcl \
exec tclsh "$0" ${1+"$@"}
button .exit_button -text "QUIT" -command exit
puts "The exit button text is: [.exit_button cget -text]"
puts "The exit button color is: [.exit_button cget -background]"
set clickButton [button .b1 -text "Please Click Me" \
-command {.b1 configure -text "I’ve been Clicked!"}]
pack .b1
pack .exit_button
# simpl_brrn.tcl \
exec tclsh "$0" ${1+"$@"}
button .exit_button -text "QUIT" -command exit
puts "The exit button text is: [.exit_button cget -text]"
puts "The exit button color is: [.exit_button cget -background]"
set clickButton [button .b1 -text "Please Click Me" \
-command {.b1 configure -text "I’ve been Clicked!"}]
pack .b1
pack .exit_button
result in console you will see due to line number 2 &3
ReplyDeleteThe exit button text is: QUIT
The exit button color is: SystemButtonFace
The cget subcommand will return the current value of a widget option
configure Return or set configuration values.