Tk Library Source Code

Artifact [c646f86da2]
Login

Artifact c646f86da226bab61ca6bab01615015093b9c8a0:

Attachment "passwddlg.patch" to ticket [922877ffff] added by stevel 2004-03-25 10:16:16.
Index: passwddlg.tcl
===================================================================
RCS file: /cvsroot/tcllib/bwidget/passwddlg.tcl,v
retrieving revision 1.8
diff -u -r1.8 passwddlg.tcl
--- passwddlg.tcl	20 Oct 2003 21:23:52 -0000	1.8
+++ passwddlg.tcl	25 Mar 2004 02:35:35 -0000
@@ -89,7 +89,7 @@
     }
 
     set frame [Dialog::getframe $path]
-#    bind $path  <Return>  ""
+    bind $path  <Return>  ""
     bind $frame <Destroy> [list Widget::destroy $path\#PasswdDlg]
 
     set lablog [eval [list LabelEntry::create $frame.lablog] \
@@ -105,14 +105,15 @@
 			  -command [list PasswdDlg::_verifonlogin \
 					$path $frame.lablog]]]
 
-    # compute label width -- TODO: this should probably not override the
-    # cmdline arg
-    set loglabel  [$lablog cget -label]
-    set passlabel [$labpass cget -label]
-    set labwidth  [_max [string length $loglabel] [string length $passlabel]]
-    incr labwidth 1
-    $lablog  configure -labelwidth $labwidth
-    $labpass configure -labelwidth $labwidth
+    # compute label width
+    if {[$lablog cget -labelwidth] == 0} {
+        set loglabel  [$lablog cget -label]
+        set passlabel [$labpass cget -label]
+        set labwidth  [_max [string length $loglabel] [string length $passlabel]]
+        incr labwidth 1
+        $lablog  configure -labelwidth $labwidth
+        $labpass configure -labelwidth $labwidth
+    }
 
     Widget::create PasswdDlg $path 0