仅仅使Tcl/Tk方案真正简单易懂,但我没有什么麻烦。
在被点击时,我需要打上ton子的颜色,这样,它就会开始红色,被点击就会变成绿色,如果再点击就会回红。
I have got it changing from red to green, but I don t know how to make it go back the other way. What is the best way to do this?
仅仅使Tcl/Tk方案真正简单易懂,但我没有什么麻烦。
在被点击时,我需要打上ton子的颜色,这样,它就会开始红色,被点击就会变成绿色,如果再点击就会回红。
I have got it changing from red to green, but I don t know how to make it go back the other way. What is the best way to do this?
这并非非常困难(除了在OSX上,这种事情是directly<>/em>,反对平台协调准则)。
button .b -background red -command [list toggleTheButton .b]
set state(.b) 1
proc toggleTheButton w {
global state
if {$state($w)} {
$w configure -background green
} else {
$w configure -background red
}
set state($w) [expr {!$state($w)}]
}
考虑使用<代码>checkbutton 相反,当你们需要聚合时,因为用户会更迅速地理解它。
I am translating some lisp code to Tcl and wonder if there is anything like lisp s defstruct in Tcl for creating data structures? If nothing is built into Tcl, what extension packages to Tcl would ...
I want to clear the screen (on the local machine) after exiting from my (semi) interactive expect script. Can I do that from within the script? Here s what I tried, that failed. #!/usr/bin/expect -f ...
We are testing a DSL modem s web pages (the HTTP server is running on the modem). We have an automation tool that configures various options on the web pages by sending POSTS of the respective web ...
I wrote tcl script as an glue between different apps which are computationally intensive. When I run top command I see that 2 cpu s are 100% utilized. The one is for the tcl and the second is for the ...
I ve started a project(developer text editor) in a interpreted language(Tcl/Tk) and another with Perl(both are open-source), but with some time, when it gets in a Beta version, I will need to ...
I m now learning Tcl/Tk, but as I m running Windows, I want to create a fully featured(professional) development environment for this language, but I need to know: Which tools I need to install(first ...
I just finished a TCL Db App that includes a featrue to open web page URLs. My code is as follows ($adr is the url): eval exec [auto_execok start] "" [list $adr] This code works fine on my ...
I have an existing Python 2.4 and it is working properly with tkinter as I tested it using python import _tkinter import Tkinter Tkinter._test() Now, I have installed ...