From 21be91e9060ac8057a5d128d7061c5c5ccaed63c Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Wed, 2 Dec 2009 23:37:32 +0000 Subject: [PATCH] Tidy up some dialog issues. Signed-off-by: Pat Thoyts --- bin/sockspy.tcl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/sockspy.tcl b/bin/sockspy.tcl index 2138960..d46150e 100644 --- a/bin/sockspy.tcl +++ b/bin/sockspy.tcl @@ -408,6 +408,7 @@ proc saveOutput {} { 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 @@ -416,12 +417,18 @@ proc saveOutput {} { -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 [list $dlg.ok invoke] + bind $dlg [list $dlg.cancel invoke] + tk::PlaceWindow $dlg widget . wm deiconify $dlg tkwait variable [namespace which -variable $dlg] @@ -590,7 +597,6 @@ proc timestampWindow {} { ${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) @@ -598,10 +604,13 @@ proc timestampWindow {} { ${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 @@ -904,8 +913,6 @@ proc GetSetup {} { 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" @@ -938,9 +945,12 @@ proc GetSetup {} { ${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 -- 2.23.0