| Bsoft 2.0.5 Bernard's software package

bshow_getinfo.tcl
Go to the documentation of this file.
1 ##
2 # @file bshow_getinfo.tcl
3 #
4 # @brief Procedures to show image information
5 #
6 # @author Bernard Heymann
7 # @date Created: 20010516
8 # @date Modified: 030523
9
10 ## @brief Loads the information for the current image file into a text window for display.
11 #
12 # @param filename File name.
13
14 proc getInfo {filename} {
15 if ![winfo exists .info] {
16 toplevel .info
17 frame .info.buttons
18 pack .info.buttons -side bottom -fill x
19 button .info.buttons.dismiss -text Dismiss \
20 -default active -command "destroy .info"
21 pack .info.buttons.dismiss -side left -expand 1 -pady 2
22 frame .info.frame
23 pack .info.frame -expand yes -fill both -padx 1 -pady 1
24 text .info.text -height 40 -wrap word\
25 -xscrollcommand ".info.xscroll set" \
26 -yscrollcommand ".info.yscroll set" \
27 -setgrid 1 -highlightthickness 0 -pady 2 -padx 3
28 scrollbar .info.xscroll -command ".info.text xview" \
29 -highlightthickness 0 -orient horizontal
30 scrollbar .info.yscroll -command ".info.text yview" \
31 -highlightthickness 0 -orient vertical
32
33 grid .info.text -in .info.frame -padx 1 -pady 1 \
34 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
35 grid .info.yscroll -in .info.frame -padx 1 -pady 1 \
36 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
37 grid rowconfig .info.frame 0 -weight 1 -minsize 0
38 grid columnconfig .info.frame 0 -weight 1 -minsize 0
39 } else {
40 wm deiconify .info
41 raise .info
42 }
43 wm title .info $filename
44 wm iconname .info $filename
45 catch { exec bhead -verbose 7 -info $filename} theinfo
46 .info.text delete 1.0 end
47 .info.text insert 1.0 $theinfo
48 .info.text mark set insert 1.0
49 }
50