summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter.spjuth@gmail.com <pspjuth>2002-05-26 09:25:56 (GMT)
committerpeter.spjuth@gmail.com <pspjuth>2002-05-26 09:25:56 (GMT)
commitc19b3eb722ba8c6dd0d936b8ed1af843d676ff34 (patch)
tree6a806b3a1ba1d3752ae6a98c16426064e1c914bd
parentc1077f545ca0a9bfe7a655e752344dfa91a2f819 (diff)
downloadtk-c19b3eb722ba8c6dd0d936b8ed1af843d676ff34.zip
tk-c19b3eb722ba8c6dd0d936b8ed1af843d676ff34.tar.gz
tk-c19b3eb722ba8c6dd0d936b8ed1af843d676ff34.tar.bz2
When creating a radiobutton with -value "" it was not drawn properly
if the -variable was created by the radiobutton. [Bug #548765]
-rw-r--r--ChangeLog7
-rw-r--r--generic/tkButton.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fa9071..7c50e26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+ * generic/tkButton.c (ConfigureButton): When creating
+ a radiobutton with -value "" it was not drawn properly
+ if the -variable was created by the radiobutton.
+ [Bug #548765]
+
+2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+
* generic/tkCanvText.c (ComputeTextBbox): Negative
coordinates were rounded badly causing a 1 pixel
displacement. [Bug #556526]
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 7cc4803..fc9eab1 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkButton.c,v 1.16 2002/03/20 22:55:16 dgp Exp $
+ * RCS: @(#) $Id: tkButton.c,v 1.17 2002/05/26 09:25:56 pspjuth Exp $
*/
#include "tkButton.h"
@@ -1129,6 +1129,16 @@ ConfigureButton(interp, butPtr, objc, objv)
== NULL) {
continue;
}
+
+ /*
+ * If a radiobutton has the empty string as value
+ * it should be selected.
+ */
+
+ if ((butPtr->type == TYPE_RADIO_BUTTON) &&
+ (*Tcl_GetString(butPtr->onValuePtr) == 0)) {
+ butPtr->flags |= SELECTED;
+ }
}
}