Simplistic GTK bindings for Rakudo Perl 6
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples add Cairo install instruction (for zef) Dec 2, 2018
logotype Add logo and add adjust method to scale widget, modify example 04 to … Jun 21, 2016
.gitignore Ignore resources for now Jan 19, 2017
.travis.yml bump CI Rakudo baseline for deps Jan 30, 2019
META6.json The GTK::Simple::TextView.text needs an 'is rw' to work Dec 19, 2018 Use a clearer word Jun 30, 2018

GTK::Simple Build Status Build status

GTK::Simple is a set of simple GTK 3 bindings using NativeCall. Only a few GTK widgets are currently implemented. However, these are enough to create a reasonable interactive GUI for an idiomatic Perl 6 program. Widgets are gradually being added. These include the following:

Widget Description
Button A simple button with a label and a callback
ComboBoxText A simple combo box
Entry Allows for text to be provided by the user
FileChooserButton A button that opens a file chooser dialog
Frame A bin with a decorative frame and optional label
Grid A table-like container for widgets for window design
Label Adds a line of text
LevelBar A bar that can used as a level indicator
LinkButton Create buttons bound to a URL
MarkUpLabel Adds text with GTK mark up (e.g. color and font manipulation)
Menu A simple menu with a menu item label
MenuBar A simple menu bar that contain one or more menus
MenuItem A simple menu item that can have a sub menu
MenuToolButton A menu tool button with a label or an icon
PlacesSidebar Sidebar that displays frequently-used places in the file system
Scale Allows for a number to be provided by the user
ScrolledWindow Container for widgets needing scrolling, eg., multiline texts
RadioButton A choice from multiple check buttons
Spinner Showing that something is happening
TextView Adds multiple lines of text
Toolbar A tool bar that can contain one or more menu tool buttons
VBox, HBox Widget containers which enable window layout design


use GTK::Simple;
use GTK::Simple::App;

my $app = title => "Hello GTK!" );

        my $button = => "Hello World!"),
        my $second = => "Goodbye!")

$app.border-width = 20;
$second.sensitive = False;
$button.clicked.tap({ .sensitive = False; $second.sensitive = True });
$second.clicked.tap({ $app.exit; });

The first three or four examples were written as mini tutorials to show how the system works. For more examples, please see the examples folder.


The full functionality of GTK 3 is not available in this module.


This module requires the GTK3 library to be installed. Please follow the instructions below based on your platform:

Debian Linux

sudo apt-get install libgtk-3-dev

Mac OS X

brew update
brew install gtk+3


Precompiled GTK3 DLLs are installed automatically with module installation.


To install it using zef (a module management tool bundled with Rakudo Star):

$ zef install GTK::Simple


  • To run tests:
$ prove -e "perl6 -Ilib"
  • To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"


Jonathan Worthington, jnthn on #perl6,


The Perl 6 team


The Artistic License 2.0