#!/usr/local/bin/perl -w eval 'exec /usr/local/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell use strict; use vars qw($VERSION $tk_opt); $VERSION = substr(q$Revision: 1.12 $ , 10) + 1 . ""; BEGIN { if (defined($ARGV[0]) and $ARGV[0] eq '-tk') { $tk_opt = 1; shift @ARGV; } else { $tk_opt = 0; } print STDERR <new(); $mw->withdraw; # CDE use Font Settings if available my $ufont = $mw->optionGet('userFont','UserFont'); # fixed width my $sfont = $mw->optionGet('systemFont','SystemFont'); # proportional if (defined($ufont) and defined($sfont)) { foreach ($ufont, $sfont) { s/:$//; }; $mw->optionAdd('*Font', $sfont); $mw->optionAdd('*Entry.Font', $ufont); $mw->optionAdd('*Text.Font', $ufont); } $mw->optionAdd('*Menu.tearOff', 0); my $file; foreach $file (@ARGV) { if (-d $file) { Tk::Pod->Dir($file); } else { my $tl = $mw->Pod(-file => $file); $tl->focus; } } # xxx dirty but it works. A simple $mw->destroy if $mw->children # does not work because Tk::ErrorDialogs could be created. # (they are withdrawn after Ok instead of destory'ed I guess) if ($mw->children) { $mw->repeat(1000, sub { # ErrorDialog is withdrawn not deleted :-( foreach ($mw->children) { return if "$_" =~ /^Tk::Pod/ # ->isa('Tk::Pod') } $mw->destroy; }); } else { $mw->destroy; } MainLoop; __END__ =head1 NAME tkpod - Perl/Tk POD browser =head1 SYNOPSIS tkpod [-tk] [directory]|name [...] =head1 DESCRIPTION B is a simple POD browser with hypertext capabilities. POD (L) is a simple and readable markup language that could be mixed with L code. PODs are searched by default in C<@INC>. Directories listed on the command line are added to the default search path. For each C listed on the command line B tries to to find POD in C and C in the search path. For each C a new POD browser window is opened. =head1 OPTIONS =over 4 =item B<-tk> Useful for perl/Tk documentation. When specified it adds all C subdirectories in C<@INC> to the POD search path. This way when C is selected in the browser the C documentation is found. =back =head1 USAGE How to navigate with the POD browser is described in L. It's also accessible via the menu 'Help' -> 'Usage...'. =head1 KNOWN BUGS see L =head1 SEE ALSO L L L L L L =head1 AUTHOR Nick Ing-Simmons > Code currently maintained by Achim Bohnet >. Please send bug reports to >. Copyright (c) 1997-1998 Nick Ing-Simmons. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut