Changeset 3853 for trunk


Ignore:
Timestamp:
Aug 6, 2013 6:46:51 AM (11 years ago)
Author:
gah
Message:

add search path for image files in pictures in drawings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/drawingentry.tcl

    r3808 r3853  
    583583    if { [string compare -length 7 $contents "file://"] == 0 } {
    584584        set fileName [string range $contents 7 end]
     585        set path $fileName
     586        # find the file on a search path
     587        if { [file pathtype $path] != "absolute" } {
     588            set dir [[$_owner tool] installdir]
     589            set searchlist [list $dir [file join $dir docs]]
     590            foreach dir $searchlist {
     591                if {[file readable [file join $dir $fileName]]} {
     592                    set path [file join $dir $fileName]
     593                    break
     594                }
     595            }
     596        }
    585597        if { [file exists $fileName] } {
    586598            set img [image create photo -file $fileName]
Note: See TracChangeset for help on using the changeset viewer.