prince26121991 has asked for the wisdom of the Perl Monks concerning the following question:

use Tk; use strict; Main( @ARGV ); exit( 0 ); sub Main { my $mw = MainWindow->new; $mw->geometry( "100x100" ); $mw->title( "MAIN WINDOW" ); my $button_frame12 = $mw->Frame()->pack( -side => "top", -pady => +10 ); $button_frame12->Button( -text => "HELP", -command => \&window12)- +>pack(-side => 'bottom'); MainLoop; }

I want to link a pdf file to Help Button!

If user click on this Help Button than The Pdf must open!

And please try to give a suggestion without help of module! If it's must thn only pls!

Replies are listed 'Best First'.
Re: Display or link a file
by roboticus (Chancellor) on May 18, 2014 at 22:19 UTC

    prince26121991:

    You could always make one of the resident programs on your system do the display, something like:

    sub help_button_handler { if (! fork()) { system("/usr/bin/ghostscript", $path_to_help_file); } }

    Note: I don't use the Tk module, so forking may not be the best method to spawn off a process to display the PDF file, but there will be some equivalent technique if this is the wrong one.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.