TABLE OF CONTENTS
::pwtk::getViewer
SYNOPSIS
proc ::pwtk::getViewer {type {prog {}}} {
PURPOSE
Set or query a usable viewer executable for viewing the $type documents/images.
ARGUMENTS
- type -- type of document/image (ps, eps, pdf, png, svg...)
RETURN VALUE
- A usable viewer executable or an empty string if none found.
SOURCE
variable viewers if { $prog != {} && [auto_execok $prog] != {} } { set viewer $prog } ifnotexist viewer { # take case of $type correctness switch -nocase -- $type { ps - eps - pdf - doc { set type pdf } svg { set type svg } default { set type png } } return [getExecutable {*}$viewers($type)] } }