︙ | | |
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
+
|
snit::widget DirCompare {
component tree
component hsb
component vsb
option -leftdir -default "" -configuremethod SetDirOption
option -rightdir -default "" -configuremethod SetDirOption
option -statusvar -default ""
variable AfterId ""
variable IdleQueue {}
variable IdleQueueArr
variable leftMark ""
variable rightMark ""
|
︙ | | |
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
|
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
|
+
+
+
+
+
+
+
+
+
+
+
+
|
$self UpdateDirNode $node
}
# Work for at least 20 ms to keep things efficient
set post [clock clicks -milliseconds]
if {($post - $pre) > 20} break
}
if {$options(-statusvar) ne ""} {
upvar \#0 $options(-statusvar) statusvar
}
if {[llength $IdleQueue] > 0} {
set leftfull [$tree set $node leftfull]
set rightfull [$tree set $node rightfull]
if {$leftfull ne ""} {
set statusvar $leftfull
} else {
set statusvar $rightfull
}
set AfterId [after 1 [mymethod UpdateIdle]]
} else {
set statusvar ""
set AfterId ""
}
}
method SetNodeStatus {node status} {
$tree set $node status $status
$tree item $node -tags $status
|
︙ | | |
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
|
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
|
+
-
+
|
}
}
snit::widget DirDiff {
hulltype toplevel
widgetclass Toplevel
component tree
variable statusVar
constructor {args} {
lappend ::diff(diffWindows) $win
wm title $win "Eskil Dir"
wm protocol $win WM_DELETE_WINDOW [list cleanupAndExit $win]
install tree using DirCompare $win.dc -leftdir $::dirdiff(leftDir) \
-rightdir $::dirdiff(rightDir)
-rightdir $::dirdiff(rightDir) -statusvar [myvar statusVar]
frame $win.fe1
frame $win.fe2
menu $win.m
$hull configure -menu $win.m
|
︙ | | |
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
|
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
|
+
+
+
|
button $win.bu2 -text "Up" -padx 10 -command [mymethod UpDir 2]
button $win.bb2 -text "Browse" -padx 10 \
-command "[list BrowseDir dirdiff(rightDir) $win.e2]
[mymethod DoDirCompare]"
$win.e2 xview end
bind $win.e1 <Return> [mymethod DoDirCompare]
bind $win.e2 <Return> [mymethod DoDirCompare]
label $win.sl -anchor w -textvariable [myvar statusVar]
pack $win.bb1 $win.bu1 -in $win.fe1 -side right -pady 1
pack $win.bu1 -padx 6
pack $win.e1 -in $win.fe1 -side left -fill x -expand 1
pack $win.bb2 $win.bu2 -in $win.fe2 -side right -pady 1
pack $win.bu2 -padx 6
pack $win.e2 -in $win.fe2 -side left -fill x -expand 1
grid $win.fe1 $win.bu $win.fe2 -sticky we
grid $tree - - -sticky news
grid $win.sl - - -sticky we
grid $win.bu -padx 6
grid rowconfigure $win 1 -weight 1
grid columnconfigure $win {0 2} -weight 1
}
method DoDirCompare {} {
|
︙ | | |