Monday, 13 March 2017

Simple Button development without writing procedure

#!/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

1 comment:

  1. result in console you will see due to line number 2 &3
    The 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.

    ReplyDelete