A simpler and more efficient API for GTK::Simple
Perl 6
Switch branches/tags
Nothing to show
Latest commit 668a560 Dec 17, 2017 @azawawi azawawi Merge pull request #1 from samcv/SPDX-license
Use SPDX identifier in license field of META6.json
Permalink
Failed to load latest commit information.
doc Update docs and add markdown docs update script Jan 20, 2017
examples Add link-button, level-bar and scroll-window helper subs Jan 20, 2017
lib/GTK Update docs and add markdown docs update script Jan 20, 2017
t Fix broken ci scripts and use 2016.11 (rakudo star) for testing. Part… Jan 20, 2017
tools
.gitignore GTK::Simpler is born May 27, 2016
.travis.yml More CI fixes. Test on latest in AppVeyor Jan 20, 2017
LICENSE
META6.json Use SPDX identifier in license field of META6.json Apr 28, 2017
README.md Complete switch to zef from panda. Update docs Jan 20, 2017
appveyor.yml More CI fixes. Test on latest in AppVeyor Jan 20, 2017

README.md

GTK::Simpler Build Status Build status

This module provides a simpler API for GTK::Simple. The idea here is to load GTK::Simple widgets lazily at runtime and type less characters. For example instead of writing the following:

# This is slow since it will load a lot of GTK::Simple widgets by default
use GTK::Simple;

my $app = GTK::Simple::App.new(title => "Hello");

you write the more concise shorter form:

# Exports a bunch of subroutines by default
use GTK::Simpler;

# GTK::Simple::App is loaded and created only here
my $app = app(title => "Hello");

Example

use v6;
use GTK::Simpler;

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

$app.set-content(
    vbox(
        my $first-button  = button(label => "Hello World!"),
        my $second-button = button(label => "Goodbye!")
    )
);

$app.border-width        = 20;
$second-button.sensitive = False;

$first-button.clicked.tap({ 
    .sensitive = False; 
    $second-button.sensitive = True 
});

$second-button.clicked.tap({ 
    $app.exit; 
});

$app.run;

For more examples, please see the examples folder.

Documentation

Please see the GTK::Simpler generated documentation.

Installation

Please check GTK::Simple prerequisites section for more information.

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

$ zef install GTK::Simpler

Testing

  • 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 -ve "perl6 -Ilib"

Author

Ahmad M. Zawawi, azawawi on #perl6

License

MIT License