patch-2.2.16 linux/scripts/tail.tk

Next file: linux/scripts/tkcond.c
Previous file: linux/scripts/mkdep.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/scripts/tail.tk linux/scripts/tail.tk
@@ -29,10 +29,12 @@
 	read_config $defaults
 }
 
-update_mainmenu .f0
+update_define 1 $total_menus 0
+update_mainmenu
 
 button .f0.right.save -anchor w -text "Save and Exit" \
-    -command { writeconfig .config include/linux/autoconf.h; wrapup .wrap }
+    -command { catch {exec cp -f .config .config.old}; \
+		writeconfig .config include/linux/autoconf.h; wrapup .wrap }
 
 button .f0.right.quit -anchor w -text "Quit Without Saving" \
     -command { maybe_exit .maybe }
@@ -52,6 +54,16 @@
     -padx 0 -pady 0 -side bottom -fill x
 pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
 pack .f0 -padx 5 -pady 5
+
+update idletasks
+set winy [expr 10 + [winfo reqheight .f0]]
+set scry [lindex [wm maxsize .] 1]
+set winx [expr 10 + [winfo reqwidth .f0]]
+set scrx [lindex [wm maxsize .] 0]
+if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
+if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
+.f0 configure -width $winx -height $winy 
+wm maxsize . $maxx $maxy
 
 #
 # If we cannot write our config files, disable the write button.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)