Tk (software)
Template:Short description Template:DMCA
Page Module:Infobox/styles.css has no content.
| Tk | |
|---|---|
| Lua error in package.lua at line 80: module 'Module:InfoboxImage/data' not found. Tcl logo | |
| Lua error in package.lua at line 80: module 'Module:InfoboxImage/data' not found. Tk 8.6.6 on Windows 10 | |
| [[Programmer|Original authorTemplate:Pluralize from text]] | John Ousterhout |
| [[Programmer|DeveloperTemplate:Pluralize from text]] | Tcl Core Team[1] |
| Initial release | 1991 |
| Written in | C |
| Operating system | Cross-platform |
| Platform | Cross-platform |
| Type | Widget toolkit |
| License | BSD-style[2] |
| Website | tcl.tk |
Script error: No such module "Check for conflicting parameters".
Tk is a cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. It is free and open-source software released under a BSD-style software license.
Tk provides many widgets commonly needed to develop desktop applications, such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, macOS, Unix, and Microsoft Windows. Like Tcl, Tk 8.6 supports Unicode within the Basic Multilingual Plane, while Tk 9 supports the full Unicode range.
Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.[3][4]
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).[5] Highlights of version 8.5 include a new theming engine, originally called Tk Tile,[6] but it is now generally referred to as "themed Tk", as well as improved font rendering.[7] Highlights of version 8.6 include PNG support and angled text.[8]
History
Tk was developed by John Ousterhout as an extension for the Tcl scripting language. It was first publicly released in 1991.[9] Tk versioning was done separately from Tcl until version 8.0.
Tk was written originally for Unix/X11, and proved extremely popular with programmers in the 1990s by virtue of its being easier to learn and use than Motif and other X11 toolkits of the time.[10] Tk was also ported to Microsoft Windows and Macintosh platforms, starting with Tk 4.2 and improved with native look and feel in Tk 8.0 (released 1997). To mark the popularity and significance of Tk in the 1990s, Ousterhout was given the ACM Software System Award in 1997 for Tcl/Tk:[11]
Page Template:Quote box/styles.css has no content.
For the Tcl scripting language which allows developers to create complex systems from pre-existing components. The embedded Tk provides a simple mechanism for creating graphical user interfaces. Together they make a powerful addition to the software repertoire.
Interest in Tk waned significantly from the late 1990s and onward. The default look and feel on Unix still emulated Motif, despite the mainstream replacement of Motif by toolkits such as FLTK, Qt, and GTK.[12] Widgets that became commonly used in applications (e.g. trees, combo boxes, tabbed notebooks) were not available in the Tk core, but only via multiple, often competing add-ons.[13]
Tk 8.5, released in late 2007, corrected some of these problems by adding missing widgets to the core, introducing a new theming engine and modernizing the look and feel on Unix.[7] However, because some code changes were required to incorporate these advancements, many existing applications retain the older Motif-inspired feel that Tk had become known for.[14]
Architecture
Tk is a platform-independent GUI framework developed for Tcl. From a Tcl shell (tclsh), Tk may be invoked using the command package require Tk. The program wish (WIndowing SHell) provides a way to run a tclsh shell in a graphical window as well as providing Tk.[15]
Tk has the following characteristics:
- Platform-independent: Like Tcl, Tk is interpreted. It has been ported to multiple platforms and can easily run on all of them without modification.[16]
- Customizable: Almost all the features of a widget in Tk are customizable through options during the creation of the widget or later on through the configure command.[17]
- Configurable: Many of the options can be stored in an option database, making it very easy to parameterize the look of an application (such as the color scheme). This also means that storing the application-specific options is only a matter of saving the option add commands and executing them on loading the application.[18]
Language bindings
A library written in one programming language may be used in another language if bindings are written; Tk is integrated with the Tcl language. Various other languages have bindings for Tk, a partial list of which is on the Tk website.[19] Bindings exist for additional languages which might not be listed, including Ada (called TASH),[20] Go (through [21]), Haskell (called HTk),[22] Perl, Python (called Tkinter), R (through the standard package: tcltk), Ruby, Rexx, and Common Lisp.
There are several ways to use Tk from Perl: the Tcl::Tk and Tkx Perl modules,[23] both of which use Tcl as a bridge to access Tk, and Perl/Tk,[24] which provides native Perl access to Tk structures. The Python binding uses Tcl as a bridge to Tk.[25]
Features
Tk provides various widgets.[26] Basic widgets are embedded into toplevel widgets, which in turn are usually hosted by the operating system in floating windows that can be moved around on the screen.[27]
Basic widgets
Script error: No such module "Template wrapper".
Top-level widgets
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– creates a modal dialog and waits for a response.tk_getOpenFile– pops up a dialog box for the user to select a file to open.tk_getSaveFile– pops up a dialog box for the user to select a file to save.tk_messageBox– pops up a message window and waits for a user response.tk_popup– posts a popup menu.toplevel– creates and manipulates toplevel widgets.
Geometry managers
Basic widgets are arranged in toplevel windows using geometry managers:[28]
place– positions widgets at absolute locationsgrid– arranges widgets in a gridpack– packs widgets into a cavity
See also
Lua error in mw.title.lua at line 404: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').
- List of widget toolkits
- wish (Windowing Shell)
- Expect
- Tkinter – a Tk binding for Python
- Category:Software that uses Tk (software)
References
Page Template:Reflist/styles.css has no content.
- ^ Page Module:Citation/CS1/styles.css has no content."Tcl/Tk Core Development". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."Tcl/Tk Licensing Terms". Tcl Developer Xchange. Retrieved 4 November 2016.
- ^ Writing a Tk Widget in C, Chapter 46 in Practical Programming in Tcl and Tk, Template:ISBN
- ^ Page Module:Citation/CS1/styles.css has no content."Extensions for Tcl and Tk". Tcler's Wiki. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."Tcl/Tk 8.0". Tcl Developer Xchange. 18 September 2013. Retrieved 1 July 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."Tile: an improved themeing engine for Tk". SourceForge. Retrieved 4 November 2016.
- ^ a b Page Module:Citation/CS1/styles.css has no content."Tcl/Tk 8.5 Release Announcement". Tcl Developer Xchange. 18 September 2013. Retrieved 1 July 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."Tcl/Tk 8.6 Release Announcement". Tcl Developer Xchange. 20 September 2013. Retrieved 1 July 2014.
- ^ Page Module:Citation/CS1/styles.css has no content.Ousterhout, John. "History of Tcl". Tcl Developer Exchange. Retrieved 1 April 2010.
- ^ Page Module:Citation/CS1/styles.css has no content."Tk Backgrounder". TkDocs. Retrieved 4 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."John K Ousterhout - Award Winner". ACM Awards. Retrieved 4 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."TIP #48: Tk Widget Styling Support". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."treeview". Tcler's Wiki. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."TIP #319: Implement Backwards Compatibility for ttk Themed Widgets in tk Widgets". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."wish manual page - Tk Applications". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."How to Compile Tcl". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."ttk::widget manual page - Tk Themed Widget". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."option manual page - Built-In Commands". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."Languages with a Tk binding". Tcler's Wiki. Retrieved 1 July 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."TASH". SourceForge. Retrieved 1 July 2014.
- ^ Page Module:Citation/CS1/styles.css has no content."tk9.0: The CGo-free, cross platform GUI toolkit for Go". Go Packages. Retrieved 22 November 2024.
- ^ Page Module:Citation/CS1/styles.css has no content."HTk home". Informatik - FB3 - Uni Bremen. Retrieved 4 November 2016.
- ^ Page Module:Citation/CS1/styles.css has no content."Tkx::Tutorial - How to use Tkx". ActiveState Docs. Retrieved 1 November 2016.
- ^ Perl/Tk Concepts, Chapter 1 in Mastering Perl/Tk, Template:ISBN
- ^ Tkinter, Chapter 2.4 in Modern Tkinter for Busy Python Developers, ASIN B0071QDNLO
- ^ Page Module:Citation/CS1/styles.css has no content."Tk Commands, version 8.6.6". Tcl Developer Xchange. Retrieved 1 November 2016.
- ^ Widgets, Chapter 17.2 in Tcl and the Tk Toolkit , Template:ISBN
- ^ Geometry Managers, Chapter 17.6 in Tcl and the Tk Toolkit , Template:ISBN
Further reading
Page Template:Refbegin/styles.css has no content.
- Page Module:Citation/CS1/styles.css has no content.Ousterhout, John K.; Jones, Ken (2009). Tcl and the Tk Toolkit (2nd ed.). Addison Wesley. ISBN 978-0-321-33633-0. Retrieved 4 November 2012.
- Page Module:Citation/CS1/styles.css has no content.Foster-Johnson, Eric (1997). Graphical Applications with Tcl & Tk (2nd ed.). New York, N.Y.: M&T Books. ISBN 1-55851-569-0. Retrieved 4 November 2012.
- Brent B. Welch, Practical Programming in Tcl and Tk, Prentice Hall, Upper Saddle River, NJ, USA, Template:ISBN, 2003
- J Adrian Zimmer, Tcl/Tk for Programmers Script error: No such module "webarchive"., IEEE Computer Society, distributed by John Wiley and Sons, Template:ISBN, 1998
- Mark Harrison and Michael McLennan, Effective Tcl/Tk Programming, Addison-Wesley, Reading, MA, USA, Template:ISBN, 1998
- Bert Wheeler, Tcl/Tk 8.5 Programming Cookbook, Packt Publishing, Birmingham, England, UK, Template:ISBN, 2011
- Clif Flynt Tcl/Tk, Third Edition: A Developer’s Guide, Template:ISBN, 2012
External links
Page Module:Side box/styles.css has no content.Page Template:Sister project/styles.css has no content.
- Official website
- Tcler's Wiki
- Tk 8.6 Manual
- Tk docs: modern Tk tutorial for Tcl, Ruby, Perl and Python
- Languages with a Tk binding
Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found. Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found. Lua error in package.lua at line 80: module 'Module:Authority control/config' not found.