2 # This file is boilerplate TCL/TK function definitions for 'make xconfig'.
7 # 8 January 1998, Michael Elizabeth Chastain, <mec@shout.net>
8 # Arrange buttons in three columns for better screen fitting.
12 # Read the user's settings from .config. These will override whatever is
13 # in config.in. Don't do this if the user specified a -D to force
16 if { [file readable .config] == 1} then {
17 if { $argc > 0 } then {
18 if { [lindex $argv 0] != "-D" } then {
32 update_define 1 $total_menus 0
35 button .f0.right.save -anchor w -text "Save and Exit" -underline 0\
36 -command { catch {exec cp -f .config .config.old}; \
37 writeconfig .config include/linux/autoconf.h; wrapup .wrap }
39 button .f0.right.quit -anchor w -text "Quit Without Saving" -underline 0\
40 -command { maybe_exit .maybe }
42 button .f0.right.load -anchor w -text "Load Configuration from File" \
43 -command { load_configfile .load "Load Configuration from file" read_config_file
46 button .f0.right.store -anchor w -text "Store Configuration to File" \
47 -command { load_configfile .load "Store Configuration to file" write_config_file }
50 # Now pack everything.
53 pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \
54 -padx 0 -pady 0 -side bottom -fill x
55 pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
56 pack .f0 -padx 5 -pady 5
59 set winy [expr 10 + [winfo reqheight .f0]]
60 set scry [lindex [wm maxsize .] 1]
61 set winx [expr 10 + [winfo reqwidth .f0]]
62 set scrx [lindex [wm maxsize .] 0]
63 if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
64 if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
65 .f0 configure -width $winx -height $winy
66 wm maxsize . $maxx $maxy
69 # If we cannot write our config files, disable the write button.
71 if { [file exists .config] == 1 } then {
72 if { [file writable .config] == 0 } then {
73 .f0.right.save configure -state disabled
76 if { [file writable .] == 0 } then {
77 .f0.right.save configure -state disabled
81 if { [file exists include/linux/autoconf.h] == 1 } then {
82 if { [file writable include/linux/autoconf.h] == 0 } then {
83 .f0.right.save configure -state disabled
86 if { [file writable include/linux/] == 0 } then {
87 .f0.right.save configure -state disabled