Skip to content

Commit

Permalink
More typing
Browse files Browse the repository at this point in the history
  • Loading branch information
azawawi committed Jun 6, 2016
1 parent f9cc80a commit e17ffa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/09-toolbar.pl6
Expand Up @@ -32,7 +32,7 @@ my $bottom-button = GTK::Simple::Button.new(:label("Bottom space")),
$app.set-content(
GTK::Simple::VBox.new(
[
{:widget($toolbar-vbox), :expand(0)},
{ :widget($toolbar-vbox), :expand(False) },
$bottom-button
]
)
Expand Down
9 changes: 5 additions & 4 deletions lib/GTK/Simple/Box.pm6
Expand Up @@ -4,6 +4,7 @@ use v6;
use GTK::Simple::Raw :box, :DEFAULT;
use GTK::Simple::Common;
use GTK::Simple::Container;
use GTK::Simple::Widget;

unit role GTK::Simple::Box does GTK::Simple::Container;

Expand All @@ -14,8 +15,8 @@ multi method new(*@packees) {
if $_ ~~ Hash {
$box.pack-start(
$_<widget>,
$_<expand> // 0,
$_<fill> // 0,
$_<expand> // True,
$_<fill> // True,
$_<padding> // 0
);
} else {
Expand All @@ -26,13 +27,13 @@ multi method new(*@packees) {
$box
}

multi method pack-start($widget, Int $expand, Int $fill, Int $padding) {
multi method pack-start(GTK::Simple::Widget:D $widget, Bool $expand, Bool $fill, Int $padding) {
gtk_box_pack_start(self.WIDGET, $widget.WIDGET, $expand, $fill, $padding);
gtk_widget_show($widget.WIDGET);
}

multi method pack-start($widget) {
self.pack-start($widget, 1, 1, 0);
self.pack-start($widget, True, True, 0);
}

multi method pack_start($widget) {
Expand Down

0 comments on commit e17ffa9

Please sign in to comment.