Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow setting of "digits" on Scale widget
  • Loading branch information
jonathanstowe committed May 17, 2016
1 parent 075d8bb commit 1a9fb5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/GTK/Simple.pm6
Expand Up @@ -527,13 +527,13 @@ class GTK::Simple::Scale does GTK::Simple::Widget {
is native(&gtk-lib)
{*}

submethod BUILD(:$orientation = 'horizontal', :$value = 0.5, :$max = 1, :$min = 0, :$step = 0.01) {
submethod BUILD(:$orientation = 'horizontal', :$value = 0.5, :$max = 1, :$min = 0, :$step = 0.01, Int :$digits = 2) {
my $d = $orientation eq 'vertical' ?? 1 !! 0;
$!gtk_widget = gtk_scale_new_with_range(
$d.Int, $min.Num, $max.Num, $step.Num
);
gtk_range_set_inverted(self.WIDGET , True ) if $d == 1;
gtk_scale_set_digits( self.WIDGET, 2 );
gtk_scale_set_digits( self.WIDGET, $digits );
gtk_range_set_value(self.WIDGET, $value.Num);
}

Expand Down

0 comments on commit 1a9fb5e

Please sign in to comment.