GappX-NoticeBox
view release on metacpan or search on metacpan
lib/GappX/NoticeBox.pm view on Meta::CPAN
Glib::Timeout->add( $duration, sub { $self->hide; return 0; } );
}
1;
package Gapp::Layout::Default;
{
$Gapp::Layout::Default::VERSION = '0.200';
}
use Gapp::Layout;
# NoticeBox
style 'GappX::NoticeBox', sub {
my ( $l, $w ) = @_;
$w->properties->{decorated} ||= 0;
$w->properties->{opacity} ||= 0;
$w->properties->{border_width} ||= 5;
$w->properties->{gravity} ||= 'south-east';
$w->properties->{'skip-taskbar-hint'} = 1;
};
build 'GappX::NoticeBox', sub {
my ( $l, $w ) = @_;
my $gtkw = $w->gobject;
$gtkw->set_keep_above( 1 );
};
__END__
=pod
=head1 NAME
GappX::NoticeBox - NoticeBox widget
=head1 SYNOPSIS
use Gapp;
use Gapp::NoticeBox;
$box = Gapp::NoticeBox->new;
$n = Gapp::Notice->new(
icon => 'gtk-info',
text => 'Display notice to user.',
action => sub { print "Notice clicked\n" },
);
=head1 DECRIPTION
Displays a message to the user in the notification area of the desktop.
=head1 OBJECT HIERARCHY
=over 4
=item L<Gapp::Object>
=item +-- L<Gapp::Widget>
=item ....+-- Gapp::NoticeBox
=back
=head1 PROVIDED ATTRIBUTES
=over 4
=item B<display_duration>
Length of time in milliseconds to display the notice on the screen.
=over 4
=item is rw
=item isa Num
=item default 3000
=back
=item B<fade_duration>
Length of time in milliseconds it takes for the notice to fade in/fade out.
=over 4
=item is rw
=item isa Num
=item default 700
=back
=item B<fade_step>
The amount to change the up or down when fading in or out. The smaller the number,
the more steps required to complete the fade.
=over 4
=item is rw
=item isa Num
=item default .07
=back
( run in 1.781 second using v1.01-cache-2.11-cpan-d06a3f9ecfd )