On 2020-06-06 22:46, ToddAndMargo via perl6-users wrote:
On 2020-06-04 04:35, Richard Hainsworth wrote:
Todd,
I wrote you one a very long time ago, after a question from you.
The module is called "Inform". Its on the modules site.
Since it was a long time ago, there may be some bit-rot. Let me know
if there is .
The module should show how to use GTK, and there is a time-out function.
Richard, aka finanalyst
On 04/06/2020 02:55, ToddAndMargo via perl6-users wrote:
Hi All,
Okay, now I know I am pushing it. Can anyone point me to
an example of a GTK information pop up with a time out
feature? Or similar?
Many thanks,
-T
Hi Richard,
Line 29: $popup.show(...
I am not finding a method called "show" in the
documents. What is it doing here?
-T
"show" is a method exported from Informative.pm6:
method show(
Str $str?,
Int :$timer,
Bool :$show-countdown
) {
self.init if $!reinit;
$!text = $str
with $str;
gtk_label_set_markup($!inf-lable, $!text.Str);
unless @!buttons.elems {
$!timer = $timer // $!timer;
$!show-countdown = $show-countdown // $!show-countdown;
$!text = $str // $!text;
self.make-text( $!timer );
if $!timer > 0 {
my $counter = $!timer - 1;
$!tap = $!sup.tap( {
self.make-text( $counter );
if ($counter <= 0) {
self.hide();
}
$counter--;
} );
self.deleted.tap( { self.hide; });
}
}
gtk_widget_show_all($!app);
gtk_main();
}