{"id":13805167,"url":"https://github.com/nomad-software/tkd","last_synced_at":"2026-02-09T07:08:16.680Z","repository":{"id":13066465,"uuid":"15747034","full_name":"nomad-software/tkd","owner":"nomad-software","description":"GUI toolkit for the D programming language based on Tcl/Tk","archived":false,"fork":false,"pushed_at":"2021-10-15T16:40:59.000Z","size":3890,"stargazers_count":118,"open_issues_count":6,"forks_count":16,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-02T16:34:45.352Z","etag":null,"topics":["d","gui-toolkit"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nomad-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-08T20:23:11.000Z","updated_at":"2024-11-11T00:53:19.000Z","dependencies_parsed_at":"2022-06-27T01:03:01.768Z","dependency_job_id":null,"html_url":"https://github.com/nomad-software/tkd","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/nomad-software/tkd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Ftkd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Ftkd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Ftkd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Ftkd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nomad-software","download_url":"https://codeload.github.com/nomad-software/tkd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Ftkd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270998264,"owners_count":24682214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d","gui-toolkit"],"created_at":"2024-08-04T01:00:58.200Z","updated_at":"2026-02-09T07:08:16.675Z","avatar_url":"https://github.com/nomad-software.png","language":"D","readme":"#tkd\n**GUI toolkit for the D programming language**\n\n---\n\n## Overview\n\nTkd is a fully cross-platform GUI toolkit based on\n[Tcl/Tk](http://www.tcl.tk/). Tkd allows you to build GUI applications easily\nand with the knowledge of a consistent, native look and feel on every platform.\n\n### Why Tcl/Tk?\n\nTkd development was initiated based on the performance and uptake of the\n[Tkinter](https://wiki.python.org/moin/TkInter) toolkit distributed as a\nstandard part of the [Python](https://www.python.org/) programming language.\nTkinter allows developers easy access to GUI programming with very little\nlearning. Being the _de facto_ GUI toolkit of Python has introduced more\ndevelopers to GUI application programming and increased the popularity of the\nlanguage as a whole. Tkd is an attempt to provide D with the same resource.\n\n### Supported platforms\n\n* Windows\n* Linux\n* Mac OSX\n\n## Example\n\nThere is an example in this package which can be built using dub. Clone\nthis repository and use the following command to build this example to see\nwhat's possible.\n```\ndub --config=example\n```\n![The above example.](source/example/example.gif)\n\n### Usage\n\nJust import the `tkd.tkdapplication` module and all tkd elements are publically\nimported.\n\n```d\nimport tkd.tkdapplication;                               // Import Tkd.\n\nclass Application : TkdApplication                       // Extend TkdApplication.\n{\n\tprivate void exitCommand(CommandArgs args)           // Create a callback.\n\t{\n\t\tthis.exit();                                     // Exit the application.\n\t}\n\n\toverride protected void initInterface()              // Initialise user interface.\n\t{\n\t\tauto frame = new Frame(2, ReliefStyle.groove)    // Create a frame.\n\t\t\t.pack(10);                                   // Place the frame.\n\n\t\tauto label = new Label(frame, \"Hello World!\")    // Create a label.\n\t\t\t.pack(10);                                   // Place the label.\n\n\t\tauto exitButton = new Button(frame, \"Exit\")      // Create a button.\n\t\t\t.setCommand(\u0026this.exitCommand)               // Use the callback.\n\t\t\t.pack(10);                                   // Place the button.\n\t}\n}\n\nvoid main(string[] args)\n{\n\tauto app = new Application();                        // Create the application.\n\tapp.run();                                           // Run the application.\n}\n```\n\n## Documentation\n\nThere is full HTML documentation within the repository inside the\n[docs](https://github.com/nomad-software/tkd/tree/master/docs/) directory.\n\n### GUI elements\n\n#### Windows\n\nThese windows are containers for widgets to provide a user interface to the\nprogram. Every application has at least one top level window.\n\n| Window | Description |\n| :----- | :---------- |\n| [Window](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/window.html) | A window is similar to a frame except that it is created as a top level window. The primary purpose of a window is to serve as a dialog box and/or collections of widgets. |\n\n#### Menus\n\nMenus allow a user to select options from a predefined list. Menus can be\nattached to a window (via a menu bar) or popped up independantly.\n\n| Menu | Description |\n| :----- | :---------- |\n| [MenuBar](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/menu/menubar.html) | A menubar is the bar across the top of a window holding the menu items. |\n| [Menu](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/menu/menu.html) | The cascading menu that items are selected from. These menus can be nested as items in another.|\n\n#### Widgets\n\nThese are the building blocks of all Tkd applications and allow the user to\ndirectly interact with your program. These are placed on windows via geometry\nmethods.\n\n| Widget | Description |\n| :----- | :---------- |\n| [Button](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/button.html) | A button widget displays a textual label and/or image, and evaluates a command when pressed. |\n| [Canvas](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/canvas.html) | Canvas widgets implement structured graphics. A canvas displays any number of items, which may be things like rectangles, circles, lines, and text. Items may be manipulated (e.g. moved or re-colored) and commands may be associated with items in much the same way that the bind command allows commands to be bound to widgets. |\n| [CheckButton](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/checkbutton.html) | A checkbutton widget is used to show or change a setting. It has two states, selected and deselected. The state of the checkbutton may be linked to a value. |\n| [ComboBox](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/combobox.html) | A combobox combines a text field with a pop-down list of values; the user may select the value of the text field from among the values in the list. |\n| [Entry](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/entry.html) | An entry widget displays a one-line text string and allows that string to be edited by the user. |\n| [Frame](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/frame.html) | A frame widget is a container, used to group other widgets together. |\n| [LabelFrame](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/labelframe.html) | A label frame widget is a container used to group other widgets together. It has an optional label, which may be a plain text string or another widget. |\n| [Label](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/label.html) | A label widget displays a textual label and/or image. |\n| [MenuButton](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/menubutton.html) | A menu button widget displays a textual label and/or image, and displays a menu when pressed. |\n| [NoteBook](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/notebook.html) | A notebook widget manages a collection of panes and displays a single one at a time. Each pane is associated with a tab, which the user may select to change the currently-displayed pane. |\n| [PanedWindow](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/panedwindow.html) | A paned window widget displays a number of subwindows, stacked either vertically or horizontally. The user may adjust the relative sizes of the subwindows by dragging the sash between panes. |\n| [ProgressBar](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/progressbar.html) | A progress bar widget shows the status of a long-running operation. |\n| [RadioButton](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/radiobutton.html) | Radio button widgets are used in groups to show or change a set of mutually-exclusive options. |\n| [Scale](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/scale.html) | A scale widget is typically used to control the numeric value that varies uniformly over some range. A scale displays a slider that can be moved along over a trough, with the relative position of the slider over the trough indicating the value. |\n| [ScrollBar](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/scrollbar.html) | Scrollbar widgets are typically linked to an associated window that displays a document of some sort, such as a file being edited or a drawing. A scrollbar displays a thumb in the middle portion of the scrollbar, whose position and size provides information about the portion of the document visible in the associated window. The thumb may be dragged by the user to control the visible region. Depending on the theme, two or more arrow buttons may also be present; these are used to scroll the visible region in discrete units. |\n| [Separator](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/separator.html) | A separator widget displays a horizontal or vertical separator bar. |\n| [SizeGrip](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/sizegrip.html) | A sizegrip widget (also known as a grow box) allows the user to resize the containing toplevel window by pressing and dragging the grip. |\n| [SpinBox](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/spinbox.html) | A spinbox widget is an entry widget with built-in up and down buttons that are used to either modify a numeric value or to select among a set of values. |\n| [Text](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/text.html) | A text widget displays one or more lines of text and allows that text to be edited. Text widgets support embedded widgets or embedded images. |\n| [TreeView](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/treeview.html) | The treeview widget displays a hierarchical collection of items. Each item has a textual label, an optional image, and an optional list of data values. |\n\n#### Geometry methods\n\nThese methods are used to place widgets onto a window.\n\n| Method | Description |\n| :----- | :---------- |\n| [Grid](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/widget.html#Widget.grid) | Geometry method for placing this widget inside its parent using an imaginary grid. Somewhat more direct and intuitive than pack. Choose grid for tabular layouts, and when there's no good reason to choose something else. |\n| [Pack](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/widget.html#Widget.pack) | Geometry method for loosely placing this widget inside its parent using a web browser model. Widgets flow around each other in the available space. |\n| [Place](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/widget/widget.html#Widget.place) | Geometry method for placing this widget inside its parent using absolute positioning. |\n\n#### Dialog boxes\n\nThese are pre-built dialog boxes to gather various pieces of data from a user.\n\n| Dialog box | Description |\n| :----- | :---------- |\n| [ColorDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/colordialog.html) | Pops up a dialog box for the user to select a color. |\n| [DirectoryDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/directorydialog.html) | Pops up a dialog box for the user to select a directory. |\n| [FontDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/fontdialog.html) | Pops up a dialog box for the user to select a font. |\n| [MessageDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/messagedialog.html) | Pops up a dialog box with a user defined message and buttons. |\n| [OpenFileDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/openfiledialog.html) | Pops up a dialog box for the user to open a file. |\n| [SaveFileDialog](http://htmlpreview.github.io/?https://github.com/nomad-software/tkd/master/docs/tkd/window/dialog/savefiledialog.html) | Pops up a dialog box for the user to save a file. |\n\n## Building\n\n * Tkd has been developed and tested using the latest DMD compiler.\n * It's recommended to use the [dub](http://code.dlang.org/about) build tool to\n   build all Tkd projects.\n\n## Dependencies\n\n### Source code\n\nTkd requires other D source libraries to correctly use and link against\npre-existing C libraries. The source dependencies are as follows:\n\n * https://github.com/nomad-software/tcltk\n * https://github.com/nomad-software/x11\n\nDub handles these automatically and during a build acquires them. While\nbuilding, the tcltk repository is configured to link against the required\nTcl/Tk libraries, hence they need to be installed for the application to\nfunction.\n\n### Libraries\n\nTkd requires version **8.6** (or greater) of the Tcl/Tk libraries installed. A\nsmall exception is when creating a self-contained installation on Windows. See\ndetails below. Tcl/Tk itself requires the x11 libraries installed on Linux only.\n\n#### Windows\n\nYou can copy the DLL's and the initialization script library directory into the\nroot of the finished application. These files can be conveniently found in the\n`dist` folder within the [tcktk](https://github.com/nomad-software/tcltk)\nrepository. Your finished application's directory would then look something\nlike this:\n```\nproject\n├── app.exe\n├── tcl86t.dll\n├── tk86t.dll\n└── library\n    └── *.tcl files\n```\nYou can automate this process when building an application by placing the\nfollowing in the application's `dub.json` build file. Dub version **0.9.22** or\ngreater is required.\n```\n...\n\"copyFiles-windows\": [\n\t\"$TCLTK_PACKAGE_DIR/dist/$ARCH/tcl86t.dll\",\n\t\"$TCLTK_PACKAGE_DIR/dist/$ARCH/tk86t.dll\",\n\t\"$TCLTK_PACKAGE_DIR/dist/library\",\n],\n...\n```\nAlternatively, if using `dub.sdl`:\n```\n...\ncopyFiles \\\n\t\"$TCLTK_PACKAGE_DIR/dist/$ARCH/tcl86t.dll\" \\\n\t\"$TCLTK_PACKAGE_DIR/dist/$ARCH/tk86t.dll\" \\\n\t\"$TCLTK_PACKAGE_DIR/dist/library\" \\\n\tplatform=\"windows\"\n...\n```\n\n#### Linux/Mac OSX\n\nOn Linux and Mac OSX things are a little easier as both operating systems have\nTcl/Tk installed by default. If however they do not have the latest version,\nthe libraries can be updated via their respective package managers. The linked\nlibraries are **libtcl** and **libtk**.\n\n## Notes\n\n### Debugging\n\nThe following debug flags can be passed to Tkd to help debug certain issues.\n\n```\n-debug=log\n```\nWrite a log called `debug.log` in the current directory detailing all Tcl/Tk\ninteraction logging all commands the Tcl interpreter is executing. (All errors\nare marked as WARN.)\n\n```\n-debug=showTclErrors\n```\nWrite all Tcl/Tk errors to stdout. This is useful to immediately be notified of\ninterpreter errors without trawling through the debug log.\n\n### Widgets\n\n#### Canvas\n\nThe postscript methods of this widget havn't been implemented yet due to time.\nThis means no exporting to postscript files or printing is available from this\nwidget. This can be added in the future if there is need.\n\n#### Text\n\nThe extended text editing functionality of this widget has not been implement\nbecause there are better, more modern editor widgets available separately. This\ncontrol is not indended to be used as a fully featured text editor.\n","funding_links":[],"categories":["GUI Libs"],"sub_categories":["XML"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomad-software%2Ftkd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomad-software%2Ftkd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomad-software%2Ftkd/lists"}