Hi Guys,
One of the things that always irritaed me about wxPerl, was that I
couldn't set up printers. It never really felt like a full solution
because I always had to drop out to the operation system for users to do it.
Now if you are using wx 2.9.3 or above, you can access cups to set up
printers.
Here is a very simple Perl script that will do it.
Have fun.
Regards
Steve.
#!/usr/bin/perl
use v5.12;
use Wx;
use Wx::WebView;
use strict;
use warnings;
package MyApp;
use vars qw(@ISA); @ISA=qw(Wx::App);
use Wx qw[:everything];
sub OnInit {
my( $this ) = @_;
my $frame = Wx::Frame->new(undef, -1, "cups printing", [-1,-1],
[wxh()] );
$frame->{defaulturl} = 'http://localhost:631';
$frame->{webview} = Wx::WebView::New($frame, -1,
$frame->{defaulturl}, ); # wxDefaultPosition, wxDefaultSize,
$frame->SetIcon( Wx::GetWxPerlIcon() );
$frame->Centre( );
$this->SetTopWindow( $frame );
$frame->Show( 1 );
1;
}
sub wxh(){
# Returns width and height (w X h) of screen as array.
my $x = Wx::SystemSettings::GetMetric(wxSYS_SCREEN_X);
my $y = Wx::SystemSettings::GetMetric(wxSYS_SCREEN_Y);
return ($x, $y);
}
sub OnQuit {
my( $this, $event ) = @_;
$this->Close( 1 );
}
package main;
MyApp->new->MainLoop;