| Bsoft 2.0.5 Bernard's software package

bshow_voxels.tcl
Go to the documentation of this file.
1 ##
2 # @file bshow_voxels.tcl
3 #
4 # @brief Procedures to record voxel values in Bshow.
5 #
6 # @author Bernard Heymann
7 # @date Created: 20101202
8 # @date Modified: 20130924
9
10 ## @brief Handles selections from the image data.
11 #
12
13 proc Voxels { } {
14 global helv12 theimg
15 set c [getImageCanvas $theimg]
16
17 set w .wvox
18
19 if ![winfo exists $w] {
20 toplevel $w
21
22 frame $w.frame
23 pack $w.frame -expand yes -fill both -padx 1 -pady 1
24 text $w.text -width 60 -height 24 -wrap none -undo 1 -background white\
25 -xscrollcommand "$w.xscroll set" \
26 -yscrollcommand "$w.yscroll set" \
27 -setgrid 1 -highlightthickness 0 -pady 2 -padx 3
28 scrollbar $w.xscroll -command "$w.text xview" \
29 -highlightthickness 0 -orient horizontal
30 scrollbar $w.yscroll -command "$w.text yview" \
31 -highlightthickness 0 -orient vertical
32
33 grid $w.text -in $w.frame -padx 1 -pady 1 \
34 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
35 grid $w.xscroll -in $w.frame -padx 1 -pady 1 \
36 -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news
37 grid $w.yscroll -in $w.frame -padx 1 -pady 1 \
38 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
39 grid rowconfig $w.frame 0 -weight 1 -minsize 0
40 grid columnconfig $w.frame 0 -weight 1 -minsize 0
41
42 frame $w.buttons
43 button $w.buttons.save -text Save -command { saveAsTextFile $w.text }
44 button $w.buttons.clear -text Clear -command "$w.text delete 1.0 end"
45 button $w.buttons.close -text Close -command "destroy $w"
46
47 pack $w.buttons.save $w.buttons.clear $w.buttons.close -side left -expand 1
48 pack $w.buttons -side bottom -fill x -pady 2m
49
50 } else {
51 wm deiconify $w
52 raise $w
53 }
54 wm title $w "Record voxels"
55 wm iconname $w "Voxels"
56 .menuBar.window entryconfigure "Voxels" -state normal
57 bind $c <1> "mousePressed %W %x %y"
58 bind $w <Control-w> { destroy $w }
59 }
60