Does it have to be "native", or can it be HTML + JavaScript + CSS?
http://stackoverflow.com/a/8881451/716443
Certainly Perl can output HTML, JavaScript, and CSS. So a Perl application could provide the back-end platform for such a concoction.
Otherwise, you might face the more difficult task of creating Perl bindings for a C++ library that supports the Win-8 UI.
| [reply] |
The main thing I am looking for is a way for a perl script to run like a metro-style/Windows Runtime (might have a newer name).
I can format a Tk window to look like a Metro/WinRT/? app (basically fullscreen and optimized layout for touch screens). By default, when the script executes Windows switches from the Start Screen to the Desktop, then the script is executed (With the desktop in the background).
Metro-style apps don't switch to the desktop when they execute, they run in an app container which is not tied to the traditional Windows desktop.
Windows 8 Application Development info on MSDN
| [reply] |
| [reply] |
| [reply] |
The following script is an basic attempt at simulating a Windows 8 (WinRT, Metro, etc...) application GUI.
The main features are fullscreen only, no chrome, and a top and bottom app bar that are displayed when the cursor (or finger on touch screens) is at the top/bottom of the screen, and hidden otherwise.
I have used text labels on the "app bars" for demonstration purposes, a real app would have buttons that do things in place of the text labels.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
#create a new MainWindow
my $mw = MainWindow->new( -background => 'black' );
#fullscreen
$mw->geometry($mw->screenwidth.'x'.$mw->screenheight);
#remove window chrome
$mw->overrideredirect(1);
#create a Tk::Frame to act as the top app bar hotspot.
my $top_appbar = $mw->Frame( -background => $mw->cget(-background), -h
+eight => 10 )->pack( -side => 'top', -fill => 'x' );
$top_appbar->bind('<Any-Enter>' => sub { \&AppBar($top_appbar, 'show',
+ 'top'); } );
$top_appbar->bind('<Any-Leave>' => sub { \&AppBar($top_appbar, 'hide',
+ 'top'); } );
#create a Tk::Frame to act as the bottom app bar hotspot
my $bottom_appbar = $mw->Frame( -background => $mw->cget(-background),
+ -height => 10 )->pack( -side => 'bottom', -fill => 'x' );
$bottom_appbar->bind('<Any-Enter>' => sub { \&AppBar($bottom_appbar, '
+show', 'bottom'); } );
$bottom_appbar->bind('<Any-Leave>' => sub { \&AppBar($bottom_appbar, '
+hide', 'bottom'); } );
#create a Tk::Frame to hold the application's content
my $content = $mw->Frame( -background => $mw->cget(-background), -heig
+ht => $mw->screenheight-20 )->pack( -fill => 'x' );
$content->Label( -text => 'This is where the application content is di
+splayed (buttons, images, etc...)', -background => $mw->cget(-backgro
+und), -foreground => 'gray' )->pack();
sub AppBar {
my $self = shift;
my $method = shift;
my $name = shift;
if ($method eq 'show'){
#change the appbar's height and color to make it visable and u
+seable
$self->configure( -background => 'gray' );
$self->configure( -height => 50) if $name eq 'top';
if ( $name eq 'top' ){
$top_appbar->{label1} = $top_appbar->Label( -text => 'The
+navigation bar, or top app bar, is the recommended place to put navig
+ation controls that let the user access other areas of the app (butto
+ns).', -background => 'gray', -foreground => 'black' )->pack( -side =
+> 'left' );
} elsif ( $name eq 'bottom' ){
$bottom_appbar->{label1} = $bottom_appbar->Label( -text =>
+ 'The bottom app bar is the recommended place to put commands (button
+s).', -background => 'gray', -foreground => 'black' )->pack( -side =
+> 'left' );
$self->configure( -height => 50);
$mw->configure( -height => $mw->screenheight-60 );
}
} elsif ($method eq 'hide'){
#change the appbar's height and color to make it hidden and no
+t useable
$self->configure( -background => $mw->cget(-background) );
$self->configure( -height => 10) if $name eq 'top';
if ( $name eq 'top'){
$top_appbar->{label1}->packForget();
} elsif ( $name eq 'bottom' ){
$bottom_appbar->{label1}->packForget();
$self->configure( -height => 10 );
$mw->configure( -height => $mw->screenheight-20 );
}
}
$mw->update();
}
$mw->MainLoop();
| [reply] [d/l] |