Tk (computing)
Encyclopedia : T : TK : TKC : Tk (computing)
Tk is an open source, cross-platform widget toolkit, that is, a library of basic elements for building a graphical user interface (GUI).
History
Tk was developed by John Ousterhout as an extension for the Tcl scripting language. Bindings exist for several other languages, including Perl, Python, Ruby, and Common Lisp. There are two ways to use Tk from Perl: the Tcl::Tk Perl module, which uses Tcl as a bridge (this approach provides more flexibility), and Perl/Tk, which has Tcl stripped away (only adopted Tcl/Tk extensions are available). The Python and Ruby bindings also use Tcl as a bridge for Tk.
Tk has been ported to run on most flavors of Linux, Apple Macintosh, Unix, and Windows. Since Tcl/Tk 8, it offers "native look and feel" (for instance, menus and buttons are displayed in the manner of "native" software for any given platform). Also, there are several extensions to provide external drag-and-drop, non-rectangular windows, and native widgets.
Like Tcl, Tk supports Unicode within the Basic Multilingual Plane but it has not yet been extended to handle 32-bit Unicode.
Features
Tk provides the following widgets:
- button
- canvas
- checkbutton
- entry
- frame
- label
- labelframe
- listbox
- menu
- menubutton
- message
- tk_optionMenu
- panedwindow
- radiobutton
- scale
- scrollbar
- spinbox
- text
- tk_chooseColor - pops up a dialog box for the user to select a color.
- tk_chooseDirectory - pops up a dialog box for the user to select a directory.
- tk_dialog - Create modal dialog and wait for response
- tk_getOpenFile - pop up a dialog box for the user to select a file to open or save.
- tk_messageBox - pops up a message window and waits for user response.
- tk_popup - Post a popup menu
- toplevel - Create and manipulate toplevel widgets
- place - which positions widgets at absolute locations
- grid - which arranges widgets in a grid
- pack - which packs widgets into a cavity
See also
- Widget toolkit
- Tkinter - a Tk binding for Python
- Qt
- wxWidgets
External links
Generic Tk and Tcl/Tk
- [Tcl and Tk website]
- [Tk 8.4 manual]
- [Tcl/Tk Tutorial]
- [Tcl/Tk cookbook]
- [link] Collaborative community website for all aspects of Tcl and Tk
- [link] Free binary distribution of Tcl, Tk, and add-on extensions
Perl/Tk
- [Perl/Tk manual], hosted by Activestate
- [Abridged Perl/Tk Tutorial]
Ruby/Tk
- [Ruby/Tk], a chapter in The Ruby book
- [MacDevCenter.com] tutorial
- * [Part 1]
- * [Part 2]
- * [Part 3]
- [Learn Tk], another Ruby/Tk Tutorial
Common Lisp/Tk
- [LTK] LTK, the Lisp ToolKit. Tk interface (through tcl) for Common Lisp
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
