Hi,
Fairly new to Tcl so please excuse if
silly question....
I have an entry widget that includes a
-textvariable VMname that gets read in
by the user's input. I then use tk_messageBox
to output an error if a bad value is entered
for VMname, including in the error message
the value of VMname. My question, is there a
way to change the color of this textvariable to
perhaps red from within tk_messageBox -message $VMname ??
It looks like default is just black and no easy way
to change color? Any ideas, suggestions, tips, or
pointers to examples would be much appreciated!!
proc get_virtual {} {
set VMname ""
destroy .lab .ent
label .lab -text "Input your Virtual Machine Name:"
# Create an entry widget, named .ent
entry .ent -textvariable VMname
focus .ent
pack .lab
pack .ent
bind .ent <Return> {
puts "the virtual machine name is: $VMname";
if {[catch {exec /opt/SUNWuttsc/bin/uttsc -m -b -A 16 -r sound:low $VMname} result] } {
tk_messageBox -title Error -detail "Invalid Virtual Machine name:\n \"$VMname\"\n Please Re-Enter" -icon error -type ok
return
# error "$VMname: Invalid VM Name - Re-Input"
}
# set status [catch {exec /opt/SUNWuttsc/bin/uttsc -m -b -A 16 -r sound:low $VMname} result]
set VMname ""
destroy .lab .ent
}
}
Thanks in advance,
Bill
bill.mutchie@oracle.com
Fairly new to Tcl so please excuse if
silly question....
I have an entry widget that includes a
-textvariable VMname that gets read in
by the user's input. I then use tk_messageBox
to output an error if a bad value is entered
for VMname, including in the error message
the value of VMname. My question, is there a
way to change the color of this textvariable to
perhaps red from within tk_messageBox -message $VMname ??
It looks like default is just black and no easy way
to change color? Any ideas, suggestions, tips, or
pointers to examples would be much appreciated!!
proc get_virtual {} {
set VMname ""
destroy .lab .ent
label .lab -text "Input your Virtual Machine Name:"
# Create an entry widget, named .ent
entry .ent -textvariable VMname
focus .ent
pack .lab
pack .ent
bind .ent <Return> {
puts "the virtual machine name is: $VMname";
if {[catch {exec /opt/SUNWuttsc/bin/uttsc -m -b -A 16 -r sound:low $VMname} result] } {
tk_messageBox -title Error -detail "Invalid Virtual Machine name:\n \"$VMname\"\n Please Re-Enter" -icon error -type ok
return
# error "$VMname: Invalid VM Name - Re-Input"
}
# set status [catch {exec /opt/SUNWuttsc/bin/uttsc -m -b -A 16 -r sound:low $VMname} result]
set VMname ""
destroy .lab .ent
}
}
Thanks in advance,
Bill
bill.mutchie@oracle.com