Linux command
wish 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start interactive Tk shell
wish
Run a Tk script
wish [script.tcl]
Run script with arguments
wish [script.tcl] [arg1] [arg2]
Execute Tk commands directly
echo "[button .b -text Hello; pack .b]" | wish
说明
wish is a Tcl interpreter extended with Tk toolkit commands for creating graphical interfaces. It reads Tcl/Tk commands from files or standard input and executes them, creating GUI windows and widgets. When run without arguments, wish starts interactively with an empty main window and a "%" prompt for entering commands. Scripts can be made executable with #!/usr/bin/wish as the first line. Tk provides widgets including buttons, labels, entries, listboxes, canvases, menus, and more. The geometry manager commands (pack, grid, place) control widget layout.
参数
- -colormap _new_
- Use new private colormap.
- -display _display_
- X display to use.
- -geometry _geometry_
- Initial window geometry.
- -name _name_
- Use name as application name.
- -sync
- Execute X server requests synchronously.
- -visual _visual_
- Visual type for main window.
- -use _id_
- Embed in window with given id.
- --
- End of options; remaining args go to script.
FAQ
What is the wish command used for?
wish is a Tcl interpreter extended with Tk toolkit commands for creating graphical interfaces. It reads Tcl/Tk commands from files or standard input and executes them, creating GUI windows and widgets. When run without arguments, wish starts interactively with an empty main window and a "%" prompt for entering commands. Scripts can be made executable with #!/usr/bin/wish as the first line. Tk provides widgets including buttons, labels, entries, listboxes, canvases, menus, and more. The geometry manager commands (pack, grid, place) control widget layout.
How do I run a basic wish example?
Run `wish` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -colormap _new_ do in wish?
Use new private colormap.