1#/***************************************************************************** 2# * 3# * Elmer, A Finite Element Software for Multiphysical Problems 4# * 5# * Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland 6# * 7# * This program is free software; you can redistribute it and/or 8# * modify it under the terms of the GNU General Public License 9# * as published by the Free Software Foundation; either version 2 10# * of the License, or (at your option) any later version. 11# * 12# * This program is distributed in the hope that it will be useful, 13# * but WITHOUT ANY WARRANTY; without even the implied warranty of 14# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15# * GNU General Public License for more details. 16# * 17# * You should have received a copy of the GNU General Public License 18# * along with this program (in file fem/GPL-2); if not, write to the 19# * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20# * Boston, MA 02110-1301, USA. 21# * 22# *****************************************************************************/ 23 24#******************************************************************************* 25#* 26#* TIFF save utility routines 27#* 28#******************************************************************************* 29#* 30#* Author: Mikko Lyly 31#* 32#* Address: CSC - IT Center for Science Ltd. 33#* Keilaranta 14, P.O. BOX 405 34#* 02101 Espoo, Finland 35#* Tel. +358 0 457 2723 36#* Telefax: +358 0 457 2302 37#* EMail: Juha.Ruokolainen@csc.fi 38#* 39#* Date: 04 Oct 2007 40#* 41#* Modified by: 42#* 43#* Date of modification: 44#* 45#****************************************************************************** 46set TIFFFileName "elmerpost.tif" 47 48proc savetiff.Control { } { 49 global savetiff_control TIFFFileName 50 51 set savetiff_control .savetiff_control 52 53 if { [winfo exists $savetiff_control] } { 54 destroy $savetiff_control.title 55 destroy $savetiff_control.file 56 destroy $savetiff_control.save_button 57 destroy $savetiff_control.buttons 58 } else { 59 toplevel $savetiff_control 60 place_window $savetiff_control 61 } 62 63 wm title $savetiff_control "Savetiff control" 64 # 65 # File name: 66 # 67 frame $savetiff_control.file 68 69 label $savetiff_control.file.label -width 8 -text "File name:" 70 entry $savetiff_control.file.name -width 30 -textvariable TIFFFileName 71 button $savetiff_control.file.button -text "Browse.." \ 72 -command { set TIFFFileName [tk_getSaveFile -parent .savetiff_control \ 73 -title "Save Picture To File"]; } 74 pack $savetiff_control.file.label $savetiff_control.file.name \ 75 $savetiff_control.file.button -side left -expand 1 76 77 pack $savetiff_control.file -expand 1 -fill both -side top 78 # 79 # Buttons: 80 # 81 frame $savetiff_control.buttons 82 83 button $savetiff_control.buttons.close -text "Close" \ 84 -command { destroy $savetiff_control } 85 86 frame $savetiff_control.save_button 87 button $savetiff_control.save_button.save \ 88 -text "Save" -command { savetiff $TIFFFileName } 89 pack $savetiff_control.save_button.save \ 90 -side left -expand 1 -fill x 91 92 pack $savetiff_control.buttons.close -side right 93 94 pack $savetiff_control.save_button -side top -expand 1 -fill x 95 pack $savetiff_control.buttons -side top -fill x -expand 1 96} 97