TABLE OF CONTENTS


::pwtk::gp::terminals

SYNOPSIS

proc ::pwtk::gp::terminals {} {

PURPOSE

Return the list of Gnuplot terminals supported by PWTK that are available in the installed gnuplot.

SOURCE

    variable gp
    
    set pwtk_terminals [concat $gp(file.terminals) $gp(win.terminals) $gp(txt.terminals)]
    
    # workaround: it happens that [gp::gp print GPVAL_TERMINALS] may return an empty string
    for {set i 0} {$i < 10} {incr i} {
        if { [set gp_terminals [gp::gp print GPVAL_TERMINALS]] ne {} } {
            break
        }
    }

    # retain only terminals that are supported by gnuplot
    set terminals {}
    foreach term $pwtk_terminals {
        if { $term in $gp_terminals } {
            lappend terminals $term
        }
    }
    return $terminals
}