options.tk
来自「Linux程序设计(原书第2版)源码」· TK 代码 · 共 29 行
TK
29 行
#!/usr/bin/wish -f# We set the global variable state equal to 1.# We create a check button and an options menu.# These are packed side by side.set state 1checkbutton .lan -text "Language" -command {changeState} -relief flat \ -variable state -onvalue 1 -offvalue 0set optMenu [tk_optionMenu .opt lang Tcl C Lisp C++]pack .lan .opt -side left# now make C As the default using lang variableset lang C++# We need a procedure to handle the application's event.proc changeState {} { global state if $state { .opt config -state normal } else { .opt config -state disabled }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?