/usr/share/doc/libwx-perl/examples/dialog/dialog.pl is in libwx-perl 1:0.9923-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #!/usr/bin/perl -w
#############################################################################
## Name: samples/dialog/dialog.pl
## Purpose: Dialog wxPerl sample
## Author: Mattia Barbon
## Modified by:
## Created: 12/11/2000
## RCS-ID: $Id: dialog.pl 2057 2007-06-18 23:03:00Z mbarbon $
## Copyright: (c) 2000, 2004, 2006 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
use Wx;
package MyDialog;
use strict;
use base qw(Wx::Dialog);
use Wx::Event qw(EVT_CLOSE EVT_BUTTON);
use Wx qw(wxDefaultSize wxDefaultValidator);
sub new {
my( $class, $label ) = @_;
my $this = $class->SUPER::new( undef, -1, $label, [-1, -1], [250, 110] );
$this->SetIcon( Wx::GetWxPerlIcon() );
# absolute positioning is bad
my $ct = $this->{celsius} =
Wx::TextCtrl->new( $this, -1, '0', [20, 20], [100, -1] );
my $cb = Wx::Button->new( $this, -1, 'To Fahrenheit', [130, 20] );
my $ft = $this->{fahrenheit} =
Wx::TextCtrl->new( $this, -1, '32', [20, 50], [100, -1] );
my $fb = Wx::Button->new( $this, -1, 'To Celsius', [130, 50] );
EVT_BUTTON( $this, $cb, \&CelsiusToFahrenheit );
EVT_BUTTON( $this, $fb, \&FahrenheitToCelsius );
EVT_CLOSE( $this, \&OnClose );
return $this;
}
sub CelsiusToFahrenheit {
my( $this, $event ) = @_;
$this->fahrenheit->SetValue( ( $this->celsius->GetValue /
100.0 ) * 180 + 32 );
}
sub FahrenheitToCelsius {
my( $this, $event ) = @_;
$this->celsius->SetValue( ( ( $this->fahrenheit->GetValue - 32 ) /
180.0 ) * 100 );
}
sub OnClose {
my( $this, $event ) = @_;
$this->Destroy;
}
sub fahrenheit { $_[0]->{fahrenheit} }
sub celsius { $_[0]->{celsius} }
package main;
my $app = Wx::SimpleApp->new;
my $dialog = MyDialog->new( "wxPerl dialog sample" );
$dialog->Show;
$app->MainLoop;
|