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

RETURN VALUE

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)]
    }
}