foreach name {server client both} {
set b [${NS}::radiobutton $f.$name -text $name \
-variable ::but -value $name]
+ if {$NS ne "::ttk"} {$b configure -anchor w}
grid $b -sticky ew
}
grid columnconfigure $f 0 -weight 1
-command [list set [namespace which -variable $dlg] ok]
${NS}::button $dlg.cancel -text Cancel \
-command [list set [namespace which -variable $dlg] cancel]
+ if {$NS ne "::ttk"} {
+ foreach b {ok cancel} {$dlg.$b configure -width -10}
+ }
grid $f - -sticky news -padx 2 -pady 2
grid $dlg.ok $dlg.cancel -sticky se
grid columnconfigure $dlg 0 -weight 1
grid rowconfigure $dlg 0 -weight 1
+ bind $dlg <Return> [list $dlg.ok invoke]
+ bind $dlg <Escape> [list $dlg.cancel invoke]
+
tk::PlaceWindow $dlg widget .
wm deiconify $dlg
tkwait variable [namespace which -variable $dlg]
${NS}::labelframe .tf.top ;#-bd 2 -relief raised -padx 5
- #message .tf.t -aspect 500 -text $txt
${NS}::label .tf.t -text $txt
${NS}::label .tf.l -text "Format: "
${NS}::entry .tf.e -textvariable state(timeFormat)
${NS}::button .tf.default -text Default -underline 0 \
-command {tfButton default}
${NS}::button .tf.cancel -text Cancel -command {tfButton cancel}
-
+ if {$NS ne "::ttk"} {
+ foreach b {ok cancel default} {.tf.$b configure -width -10}
+ }
+
grid .tf.top -row 0 -column 0 -columnspan 4 -sticky ew -padx 10 -pady 10
grid columnconfigure .tf 0 -weight 1
- grid x .tf.ok .tf.default .tf.cancel -padx 5 -sticky ew
+ grid x .tf.ok .tf.default .tf.cancel -padx 2 -sticky ew
grid rowconfigure .tf 2 -minsize 8
grid .tf.t - -in .tf.top -row 0
wm withdraw .dlg
wm title .dlg "SockSpy Setup"
wm transient .dlg .
- #wm geom .dlg +176+176
- tk::PlaceWindow .dlg widget .
${NS}::label .dlg.top
set msg "You can configure SockSpy to either forward data\n"
${NS}::label .dlg.cllabel -text "Command Line Equivalent"
${NS}::entry .dlg.clvar -textvariable SP(cmdLine)
# -state readonly doesn't seem to work, sigh
-
+
${NS}::button .dlg.ok -text OK -default active -command ValidForm
${NS}::button .dlg.cancel -text Cancel -command [list destroy .dlg]
+ if {$NS ne "::ttk"} {
+ foreach win {.dlg.ok .dlg.cancel} {$win configure -width -10}
+ }
grid .dlg.top -row 0 -column 0 -columnspan 3 -sticky ew -padx 2 -pady 2
grid columnconfigure .dlg 0 -weight 1