# Perl Tk
{id: tk}

## Perl Tk
{id: tk-perl}

* A graphical user interface toolkit for Perl
* [Perl Tk](https://metacpan.org/pod/Tk)
* [Perl Tk resource](http://www.perltk.de/) in German but with images!

## Perl Tk Plain Window
{id: tk-plain}
{i: Tk}
{i: MainWindow}
{i: MainLoop}

![](examples/tk/plain.pl)

## Perl Tk Label
{id: tk-label}
{i: Label}

![](examples/tk/label.pl)

* [Tk::Label](https://metacpan.org/pod/Tk::Label)

## Perl Tk Button
{id: tk-button}
{i: Button}

![](examples/tk/button.pl)

* [Tk::Button](https://metacpan.org/pod/Tk::Button)

## Perl Tk Entry (visible and hidden for secrets)
{id: tk-entry}
{i: Entry}

![](examples/tk/entry.pl)

* [Tk::Entry](https://metacpan.org/pod/Tk::Entry)

## Perl Tk Text editor
{id: tk-text}
{i: Text}

![](examples/tk/text.pl)

## Perl Tk Menu
{id: tk-menu}
{i: Menu}

![](examples/tk/menu.pl)

* [Tk::Menu](https://metacpan.org/pod/Tk::Menu)


## Perl Tk Keyboard binding
{id: tk-keyboard-binding}

* [Tk::bind](https://metacpan.org/pod/distribution/Tk/pod/bind.pod)

![](examples/tk/key_bindings.pl)

* Alt-F4 is already use to exit the application

## Perl Tk Any Key binding
{id: tk-any-key-binding}

![](examples/tk/any_key_bindings.pl)

## Perl Tk Mouse button and movement bindings
{id: tk-mouse-button-bindings}

* [Tk::bind](https://metacpan.org/pod/distribution/Tk/pod/bind.pod)

![](examples/tk/mouse_bindings.pl)

## Perl Tk Mouse events, coordinates
{id: tk-mouse-events-and-coordinates}
{i: XEvent}

* See the explanations [Tk::bind](https://metacpan.org/pod/distribution/Tk/pod/bind.pod#BINDING-CALLBACKS-AND-SUBSTITUTIONS)

![](examples/tk/mouse_events.pl)

## Perl Tk Checkbutton (Checkbox)
{id: tk-checkbutton}
{i: Checkbutton}

* [Tk::Checkbutton](https://metacpan.org/pod/distribution/Tk/pod/Checkbutton.pod)

![](examples/tk/check_button.pl)

## Perl Tk Radiobutton
{id: tk-radiobutton}
{i: Radiobutton}

* [Tk::Radiobutton](https://metacpan.org/pod/Tk::Radiobutton)

![](examples/tk/radio_button.pl)

## Perl Tk Listbox
{id: tk-listbox}
{i: Listbox}

* [Tk::Listbox](https://metacpan.org/pod/Tk::Listbox)


![](examples/tk/listbox.pl)

## Perl Tk Dialog
{id: tk-dialog}
{i: Dialog}

* [Tk::Dialog](https://metacpan.org/pod/Tk::Dialog)

![](examples/tk/dialog.pl)

## Perl Tk DialogBox with custom buttons and widgets
{id: tk-dialogbox}

![](examples/tk/dialog_box.pl)

![](examples/tk/color_selector_dialog_box.pl)

![](examples/tk/popout.pl)

## Perl Tk Notepad (Simple editor)
{id: tk-notepad}

![](examples/tk/notepad.pl)

## Perl Tk Message
{id: tk-message}
{i: Message}

* [Tk::Message](https://metacpan.org/pod/Tk::Message)

![](examples/tk/message.pl)

## Perl Tk with HTML
{id: tk-html}
{i: HTML}
{i: Tk::HyperText}

* [Tk::HyperText](https://metacpan.org/pod/Tk::HyperText)

![](examples/tk/html.pl)

## Perl Tk Dialog Box with HTML
{id: tk-dialog-box-with-html}
{i: HTML}
{i: Tk::HyperText}

* [Tk::HyperText](https://metacpan.org/pod/Tk::HyperText)

![](examples/tk/dialog_box_with_html.pl)


## Perl Tk Browse Entry (ComboBox)
{id: tk-browse-entry}
{i: BrowseEntry}
{i: ComboBox}

![](examples/tk/browse_entry.pl)

## Perl Tk Option Menu
{id: tk-option-menu}
{i: OptionMenu}

![](examples/tk/option_menu.pl)

## Perl Tk Table
{id: tk-table}
{i: Table}

![](examples/tk/table.pl)

## Perl Tk Menu Button
{id: tk-menu-button}
{i: Menubutton}

{aside}
I am not sure when would you want to build a menu this way. I only have this example as this is the first one I managed to create and did not want to throw it away.
{/aside}

![](examples/tk/menu_button.pl)


