Ignore:
Timestamp:
Jan 28, 2010 8:59:45 AM (14 years ago)
Author:
gah
Message:
 
Location:
branches/blt4/gui/scripts
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/scripts/animover.tcl

    r1342 r1646  
    4545    set dir [file dirname [info script]]
    4646    private common images
    47     set images(bgl) [image create photo -file \
     47    set images(bgl) [image create picture -file \
    4848        [file join $dir images bgl.gif]]
    49     set images(bgr) [image create photo -file \
     49    set images(bgr) [image create picture -file \
    5050        [file join $dir images bgr.gif]]
    5151}
  • branches/blt4/gui/scripts/balloon.tcl

    r1547 r1646  
    217217        # window). So for now, better to place the balloon window somewhere
    218218        # than to fail with a bad geometry.
     219        #
     220        # Update: This answer could be that the root window (deskop) is
     221        #         resized but XHeightOfScreen XWidthOfScreen still
     222        #         report the initial size.
    219223        wm geometry $p +$px+$py
    220224    } else {
  • branches/blt4/gui/scripts/barresult.tcl

    r1550 r1646  
    577577                }
    578578                jpg {
    579                     set img [image create photo]
     579                    set img [image create picture]
    580580                    $itk_component(plot) snap $img
    581                     set bytes [$img data -format "jpeg -quality 100"]
    582                     set bytes [Rappture::encoding::decode -as b64 $bytes]
     581                    $img export jpg -quality 100 -data bytes
    583582                    image delete $img
    584583                    return [list .jpg $bytes]
    585584                }
    586585                png {
    587                     set img [image create photo]
     586                    set img [image create picture]
    588587                    $itk_component(plot) snap $img
    589                     set bytes [$img data -format "png"]
    590                     set bytes [Rappture::encoding::decode -as b64 $bytes]
     588                    $img export png -data bytes
    591589                    image delete $img
    592590                    return [list .png $bytes]
  • branches/blt4/gui/scripts/booleanentry.tcl

    r1342 r1646  
    5656    if {$icon != ""} {
    5757        itk_component add icon {
    58             set icon [image create photo -data $icon]
     58            set icon [image create picture -data $icon]
    5959            set w [image width $icon]
    6060            set h [image height $icon]
  • branches/blt4/gui/scripts/combobox.tcl

    r1640 r1646  
    134134            $itk_component(entry) configure -state disabled
    135135        }
    136 
    137         after 10 [list catch [list event generate $itk_component(hull) <<Value>>]]
     136        set cmd [list event generate $itk_component(hull) <<Value>>]
     137        after 10 [list catch $cmd]
    138138    } elseif {[llength $args] != 0} {
    139139        error "wrong # args: should be \"value ?newval?\""
  • branches/blt4/gui/scripts/contourresult.tcl

    r1343 r1646  
    1717package require vtkinteraction
    1818package require BLT
    19 package require Img
     19#package require Img
    2020
    2121option add *ContourResult.width 4i widgetDefault
     
    303303
    304304    #
    305     # Create a photo for download snapshots
    306     #
    307     set _download [image create photo]
     305    # Create a picture for download snapshots
     306    #
     307    set _download [image create picture]
    308308
    309309    eval itk_initialize $args
     
    467467    switch $option {
    468468        coming {
    469             if {[catch {blt::winop snap $itk_component(area) $_download}]} {
    470                 $_download configure -width 1 -height 1
    471                 $_download put #000000
     469            if {[catch {_$download snap $itk_component(area)}]} {
     470                $_download blank #000000
    472471            }
    473472        }
     
    477476        }
    478477        now {
    479             # Get the image data (as base64) and decode it back to binary.
    480             # This is better than writing to temporary files.  When we switch
    481             # to the BLT picture image it won't be necessary to decode the
    482             # image data.
    483             set bytes [$_download data -format "jpeg -quality 100"]
    484             set bytes [Rappture::encoding::decode -as b64 $bytes]
     478            $_download export jpg -quality 100 -data bytes
    485479            return [list .jpg $bytes]
    486480        }
  • branches/blt4/gui/scripts/deviceLayout1D.tcl

    r1342 r1646  
    186186                    set imh $_icons($icon)
    187187                } else {
    188                     set imh [image create photo -data $icon]
     188                    set imh [image create picture -data $icon]
    189189                    set _icons($icon) $imh
    190190                }
     
    334334                set imh $_icons($icon)
    335335            } else {
    336                 set imh [image create photo -data $icon]
     336                set imh [image create picture -data $icon]
    337337                set _icons($icon) $imh
    338338            }
  • branches/blt4/gui/scripts/deviceViewer1D.tcl

    r1402 r1646  
    1616# ======================================================================
    1717package require Itk
    18 package require Img
     18#package require Img
    1919package require BLT
    2020
     
    839839    set str [$libObj get $path.icon]
    840840    if {$str != ""} {
    841         $w configure -image [image create photo -data $str]
     841        $w configure -image [image create picture -data $str]
    842842    }
    843843}
  • branches/blt4/gui/scripts/flowvisviewer.tcl

    r1545 r1646  
    1717package require Itk
    1818package require BLT
    19 package require Img
     19#package require Img
    2020
    2121option add *FlowvisViewer.width 5i widgetDefault
     
    322322
    323323    # Legend
    324     set _image(legend) [image create photo]
     324    set _image(legend) [image create picture]
    325325    itk_component add legend {
    326326        canvas $itk_component(plotarea).legend -height 50 -highlightthickness 0
     
    536536    }
    537537
    538     set _image(download) [image create photo]
     538    set _image(download) [image create picture]
    539539
    540540    eval itk_initialize $args
     
    752752    switch $option {
    753753        coming {
    754             if {[catch {
    755                 blt::winop snap $itk_component(plotarea) $_image(download)
    756             }]} {
    757                 $_image(download) configure -width 1 -height 1
    758                 $_image(download) put #000000
     754            if {[catch { $_image(download) snap $itk_component(plotarea)}]} {
     755                $_image(download) blank #000000
    759756            }
    760757        }
     
    805802            switch -- $_downloadPopup(format) {
    806803                draft {
    807                     # Get the image data (as base64) and decode it back to
    808                     # binary.  This is better than writing to temporary
    809                     # files.  When we switch to the BLT picture image it
    810                     # won't be necessary to decode the image data.
    811                     set bytes [$_image(plot) data -format "jpeg -quality 100"]
    812                     set bytes [Rappture::encoding::decode -as b64 $bytes]
     804                    $_image(plot) export jpeg -quality 100 -data bytes
    813805                    return [list .jpg $bytes]
    814806                }
  • branches/blt4/gui/scripts/heightmapviewer.tcl

    r1545 r1646  
    1616package require Itk
    1717package require BLT
    18 package require Img
     18#package require Img
    1919
    2020option add *HeightmapViewer.width 4i widgetDefault
     
    284284    }
    285285
    286     set _image(download) [image create photo]
     286    set _image(download) [image create picture]
    287287    eval itk_initialize $args
    288288    Connect
     
    470470    switch $option {
    471471        coming {
    472             if {[catch {
    473                 blt::winop snap $itk_component(plotarea) $_image(download)
    474             }]} {
    475                 $_image(download) configure -width 1 -height 1
    476                 $_image(download) put #000000
     472            if {[catch {$_image(download) snap $itk_component(plotarea)}]} {
     473                $_image(download) blank #000000
    477474            }
    478475        }
     
    482479        }
    483480        now {
    484             # Get the image data (as base64) and decode it back to binary.
    485             # This is better than writing to temporary files.  When we switch
    486             # to the BLT picture image it won't be necessary to decode the
    487             # image data.
    488             set bytes [$_image(download) data -format "jpeg -quality 100"]
    489             set bytes [Rappture::encoding::decode -as b64 $bytes]
     481            $_image(download) export jpg -quality 100 -data bytes
    490482            return [list .jpg $bytes]
    491483        }
     
    591583        set bytes [ReceiveBytes $size]
    592584        if { ![info exists _image(legend)] } {
    593             set _image(legend) [image create photo]
     585            set _image(legend) [image create picture]
    594586        }
    595587        ReceiveEcho <<line "<read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    596         set src [image create photo -data $bytes]
    597         blt::winop image rotate $src $_image(legend) 90
    598         set dst $_image(legend)
     588        set src [image create picture -data $bytes]
     589        $_image(legend) rotate $src 90
     590        image delete $src
    599591
    600592        set c $itk_component(3dview)
  • branches/blt4/gui/scripts/htmlviewer.tcl

    r1641 r1646  
    1313package require Itk
    1414package require Tkhtml
    15 package require Img
     15#package require Img
    1616
    1717option add *HTMLviewer.width 3i widgetDefault
     
    335335
    336336    foreach name $searchlist {
    337         if {[catch {image create photo -file $name} imh] == 0} {
     337        if {[catch {image create picture -file $name} imh] == 0} {
    338338            set _file2icon($fileName) $imh
    339339            set _icon2file($imh) $fileName
  • branches/blt4/gui/scripts/icons.tcl

    r1342 r1646  
    5151        switch -- [file extension $file] {
    5252            .gif - .jpg - .png {
    53                 set imh [image create photo -file $file]
     53                set imh [image create picture -file $file]
    5454            }
    5555            .xbm {
  • branches/blt4/gui/scripts/image.tcl

    r1342 r1646  
    4141    set data [string trim [$xmlobj get $path.current]]
    4242    if {[string length $data] == 0} {
    43         set _image [image create photo]
     43        set _image [image create picture]
    4444    } else {
    45         set _image [image create photo -data $data]
     45        set _image [image create picture -data $data]
    4646    }
    4747
  • branches/blt4/gui/scripts/imageentry.tcl

    r1342 r1646  
    1212# ======================================================================
    1313package require Itk
    14 package require Img
     14#package require Img
    1515
    1616itcl::class Rappture::ImageEntry {
     
    105105        set newval [lindex $args 0]
    106106        if {[string length $newval] > 0} {
    107             set imh [image create photo -data $newval]
     107            set imh [image create picture -data $newval]
    108108        } else {
    109109            set imh ""
     
    179179        auto {
    180180            if {$_resize == ""} {
    181                 set _resize [image create photo]
     181                set _resize [image create picture]
    182182            }
    183183            set w [winfo width $itk_component(image)]
     
    189189            }
    190190            $_resize configure -width $w -height $h
    191             blt::winop resample $_imh $_resize
     191            $_resize resample $_imh
    192192            $itk_component(image) configure -image $_resize
    193193        }
    194194        width=* - height=* {
    195195            if {$_resize == ""} {
    196                 set _resize [image create photo]
     196                set _resize [image create picture]
    197197            }
    198198            if {[regexp {^width=([0-9]+)$} $str match size]} {
     
    200200                set h [expr {round($w*$ih/double($iw))}]
    201201                $_resize configure -width $w -height $h
    202                 blt::winop resample $_imh $_resize
     202                $_resize resample $_imh
    203203                $itk_component(image) configure -image $_resize \
    204204                    -width $w -height $h
     
    207207                set w [expr {round($h*$iw/double($ih))}]
    208208                $_resize configure -width $w -height $h
    209                 blt::winop resample $_imh $_resize
     209                $_resize resample $_imh
    210210                $itk_component(image) configure -image $_resize \
    211211                    -width $w -height $h
  • branches/blt4/gui/scripts/imageresult.tcl

    r1552 r1646  
    1414package require Itk
    1515package require BLT
    16 package require Img
     16#package require Img
    1717
    1818option add *ImageResult.width 3i widgetDefault
     
    124124
    125125
    126     set _image(zoom) [image create photo]
    127     set _image(final) [image create photo]
     126    set _image(zoom) [image create picture]
     127    set _image(final) [image create picture]
    128128
    129129    itk_component add image {
     
    395395                $_image(final) configure -width $wf -height $hf
    396396                $_image(zoom) copy $imh -from $sx $sy
    397                 blt::winop resample $_image(zoom) $_image(final) sinc
     397                $_image(final) resample $_image(zoom) -filter sinc
    398398            }
    399399        } else {
     
    409409                $_image(zoom) configure -width $wz -height $hz
    410410                $_image(zoom) put $bg -to 0 0 $wz $hz
    411                 blt::winop resample $imh $_image(zoom) sinc
    412 
     411                $_image(zoom) resample $imh -filter sinc
    413412                $_image(final) configure -width $wz -height $hz
    414413                $_image(final) copy $_image(zoom) -from 0 0
  • branches/blt4/gui/scripts/integerentry.tcl

    r1342 r1646  
    8484    if {$str != ""} {
    8585        $itk_component(spinner) configure -image \
    86             [image create photo -data $str]
     86            [image create picture -data $str]
    8787    }
    8888
  • branches/blt4/gui/scripts/isomarker.tcl

    r1479 r1646  
    1515package require Itk
    1616package require BLT
    17 package require Img
    1817
    1918itcl::class Rappture::IsoMarker {
  • branches/blt4/gui/scripts/moleculeViewer.tcl

    r1543 r1646  
    1616package require vtkinteraction
    1717package require BLT
    18 package require Img
     18#package require Img
    1919
    2020option add *MoleculeViewer.width 3i widgetDefault
     
    192192    emblems on
    193193
    194     # create a photo for download snapshots
    195     set _download [image create photo]
     194    # create a picture for download snapshots
     195    set _download [image create picture]
    196196}
    197197
     
    318318    switch $option {
    319319        coming {
    320             if {[catch {blt::winop snap $itk_component(area) $_download}]} {
    321                 $_download configure -width 1 -height 1
    322                 $_download put #000000
     320            if {[catch {$_download snap $itk_component(area)]} {
     321                $_download blank #000000
    323322            }
    324323        }
     
    328327        }
    329328        now {
    330             # Get the image data (as base64) and decode it back to binary.
    331             # This is better than writing to temporary files.  When we switch
    332             # to the BLT picture image it won't be necessary to decode the
    333             # image data.
    334             set bytes [$_download data -format "jpeg -quality 100"]
    335             set bytes [Rappture::encoding::decode -as b64 $bytes]
     329            $_download export jpg -quality 100 -data bytes
    336330            return [list .jpg $bytes]
    337331        }
  • branches/blt4/gui/scripts/molvisviewer.tcl

    r1567 r1646  
    1515package require Itk
    1616package require BLT
    17 package require Img
     17#package require Img
    1818
    1919option add *MolvisViewer.width 4i widgetDefault
     
    15711571        switch -- $type {
    15721572            "jpg" {
    1573                 set img [image create photo -data $_hardcopy($this-$token)]
    1574                 set bytes [$img data -format "jpeg -quality 100"]
    1575                 set bytes [Rappture::encoding::decode -as b64 $bytes]
     1573                set img [image create picture -data $_hardcopy($this-$token)]
     1574                $img export jpg -quality 100 -data bytes
    15761575                return [list .jpg $bytes]
    15771576            }
    15781577            "gif" {
    1579                 set img [image create photo -data $_hardcopy($this-$token)]
    1580                 set bytes [$img data -format "gif"]
    1581                 set bytes [Rappture::encoding::decode -as b64 $bytes]
     1578                set img [image create picture -data $_hardcopy($this-$token)]
     1579                $img export gif -data bytes
    15821580                return [list .gif $bytes]
    15831581            }
  • branches/blt4/gui/scripts/nanovisviewer.tcl

    r1638 r1646  
    1515package require Itk
    1616package require BLT
    17 package require Img
     17#package require Img
    1818                                       
    1919#
     
    284284    # Legend
    285285
    286     set _image(legend) [image create photo]
     286    set _image(legend) [image create picture]
    287287    itk_component add legend {
    288288        canvas $itk_component(plotarea).legend -height 50 -highlightthickness 0
     
    355355    }
    356356
    357     set _image(download) [image create photo]
     357    set _image(download) [image create picture]
    358358
    359359    eval itk_initialize $args
     
    542542    switch $option {
    543543        coming {
    544             if {[catch {
    545                 blt::winop snap $itk_component(plotarea) $_image(download)
    546             }]} {
    547                 $_image(download) configure -width 1 -height 1
    548                 $_image(download) put #000000
     544            if {[catch { $_image(download) snap $itk_component(plotarea)}]} {
     545                $_image(download) blank #000000
    549546            }
    550547        }
     
    554551        }
    555552        now {
    556             # Get the image data (as base64) and decode it back to binary.
    557             # This is better than writing to temporary files.  When we switch
    558             # to the BLT picture image it won't be necessary to decode the
    559             # image data.
    560             if { [image width $_image(plot)] > 0 &&
    561                  [image height $_image(plot)] > 0 } {
    562                 set bytes [$_image(plot) data -format "jpeg -quality 100"]
    563                 set bytes [Rappture::encoding::decode -as b64 $bytes]
    564                 return [list .jpg $bytes]
    565             }
    566             return ""
     553            $_image(plot) export jpg -quality 100 -data bytes
     554            return [list .jpg $bytes]
    567555        }
    568556        default {
  • branches/blt4/gui/scripts/numberentry.tcl

    r1527 r1646  
    106106    set str [$_owner xml get $path.about.icon]
    107107    if {$str != ""} {
    108         $itk_component(gauge) configure -image [image create photo -data $str]
     108        $itk_component(gauge) configure -image [image create picture -data $str]
    109109    }
    110110
  • branches/blt4/gui/scripts/resultviewer.tcl

    r1587 r1646  
    1414# ======================================================================
    1515package require Itk
    16 package require Img
    1716
    1817itcl::class Rappture::ResultViewer {
  • branches/blt4/gui/scripts/visviewer.tcl

    r1547 r1646  
    132132    }
    133133    pack $itk_component(plotarea) -fill both -expand yes
    134     set _image(plot) [image create photo]
     134    set _image(plot) [image create picture]
    135135    eval itk_initialize $args
    136136}
  • branches/blt4/gui/scripts/xylegend.tcl

    r1644 r1646  
    220220itcl::body Rappture::XyLegend::Add { elem label {flags ""} } {
    221221    set hide [$graph_ element cget $elem -hide]
    222     set im [image create photo]
     222    set im [image create picture]
    223223    $graph_ legend icon $elem $im
    224224    set data(show) $hide
  • branches/blt4/gui/scripts/xyprint.tcl

    r1644 r1646  
    187187    set page $itk_component(graph_page)
    188188    set format [$page.format current]
    189 
     189   
     190    # Handle JPEG or PNG image formats.
    190191    if { $format == "jpg" } {
    191192        set img [image create picture]
     193        package require blt_picture_jpg
    192194        $_clone snap $img
    193195        $img export jpg -quality 100 -data bytes
     
    197199        set img [image create picture]
    198200        $_clone snap $img
    199         $img data png -data bytes
     201        $img export png -data bytes
    200202        image delete $img
    201203        return [list .png $bytes]
    202204    }
    203 
     205   
    204206    # Handle encapsulated postscript or portable document format.
    205207
     
    216218    set psdata [$_clone postscript output]
    217219
     220    if 0 {
     221        set f [open "junk.raw" "w"]
     222        puts -nonewline $f $psdata
     223        close $f
     224    }
    218225    if { $format == "eps" } {
    219         if 0 {
    220             set f [open "junk.raw" "w"]
    221             puts -nonewline $f $psdata
    222             close $f
    223         }
    224226        return [list .$format $psdata]
    225227    }
     
    476478
    477479itcl::body Rappture::XyPrint::GetAxisType { axis } {
    478     return $_clone axis type $axis
     480    return [$_clone axis type $axis]
    479481}
    480482
     
    996998        "18" "18" \
    997999        "20" "20"
    998     bind $page.tickfontsize <<Value>> [itcl::code $this ApplyAxisSettings]
     1000    bind $page.titlefontsize <<Value>> [itcl::code $this ApplyAxisSettings]
    9991001    Rappture::Tooltip::for $page.titlefontsize \
    10001002        "Set the size (point) of the title font."
     
    10671069        -weight $_settings($this-legend-font-weight) \
    10681070        -slant $_settings($this-legend-font-slant)
    1069     $_clone legend configure -font $_fonts(legend)
     1071    $_clone legend configure -font fixed -font $_fonts(legend)
    10701072    ApplyElementSettings
    10711073}
     
    10901092        -weight $_settings($this-axis-tickfont-weight) \
    10911093        -slant  $_settings($this-axis-tickfont-slant)
     1094    $_clone axis configure $axis -tickfont fixed -titlefont fixed
    10921095    $_clone axis configure $axis -tickfont $axis-ticks -titlefont $axis-title
     1096    if 1 {
     1097    puts stderr "$_clone axis configure $axis -tickfont $axis-ticks -titlefont $axis-title"
     1098    puts stderr "fontconf=[font configure $axis-ticks]"
     1099    }
    10931100    GetAxis
    10941101    RegeneratePreview
     
    12471254    }
    12481255    foreach {name value} [$parser eval "array get general"] {
    1249         set _settings($this-graph-$name) $value
     1256v       set _settings($this-graph-$name) $value
    12501257    }
    12511258    interp delete $parser
Note: See TracChangeset for help on using the changeset viewer.