On 4/22/19 2:22 AM, mimosin...@gmail.com wrote:
Missatge de ToddAndMargo via perl6-users <perl6-us...@perl.org> del
dia dl., 22 d’abr. 2019 a les 5:44:
I see

https://github.com/perl6/gtk-simple/tree/master/examples

but I have no clue what is going on.

Is there some kind of gtk widget that you can graphically
design these windows with?

The module provides GTK 3 bindings [1], so you can show messages to
the desktop. If you would like to start with something simpler, you
can use inform [2]. This is an example of how I receive a message to
quit my computer:
---
use v6;
use Informative;
my $action = inform( "Vols sortir de $hostname ?",
   :buttons(
     sortir => 'sortir',
     reboot => 'reboot',
     cancel => 'cancel',
   )
);

given $action.response {
   when 'sortir' {
     run "urxvt","-e","sh","-c","su -c poweroff";
   }
   when 'reboot' {
     run "urxvt","-e","sh","-c","su -c reboot";
   }
   when 'cancel' { exit }
}
---

[1] https://www.gtk.org/
[2] https://github.com/finanalyst/p6-inform


Thank you!

Reply via email to