File: testonewidget.pl

package info (click to toggle)
libtickit-async-perl 0.25-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 156 kB
  • sloc: perl: 390; makefile: 5
file content (26 lines) | stat: -r-xr-xr-x 388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

use v5.14;
use warnings;

use Tickit::Async;
use Getopt::Long;

my $widgetclass;
my $file;
GetOptions(
   'widget=s' => \$widgetclass,
   'file=s'   => \$file,
) or exit 1;

my $tickit = Tickit::Async->new;

defined $file or ( $file = "$widgetclass.pm" ) =~ s{::}{/}g;

require $file;

my $widget = $widgetclass->new;

$tickit->set_root_widget( $widget );

$tickit->run;