commit 8d188ff3d11c199621c56275d4fd6730d6f63c1b
Author: Simon Howard <fraggle@gmail.com>
AuthorDate: Mon May 22 00:26:34 2006 +0000
Commit: Simon Howard <fraggle@gmail.com>
CommitDate: Mon May 22 00:26:34 2006 +0000
More signals to detect when checkboxes/radiobuttons are changed.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 502
---
textscreen/txt_checkbox.c | 1 +
textscreen/txt_radiobutton.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/textscreen/txt_checkbox.c b/textscreen/txt_checkbox.c
index f33781c1..a61822eb 100644
--- a/textscreen/txt_checkbox.c
+++ b/textscreen/txt_checkbox.c
@@ -71,6 +71,7 @@ static int TXT_CheckBoxKeyPress(txt_widget_t *widget, int key)
if (key == KEY_ENTER || key == ' ')
{
*checkbox->variable = !*checkbox->variable;
+ TXT_EmitSignal(widget, "changed");
return 1;
}
diff --git a/textscreen/txt_radiobutton.c b/textscreen/txt_radiobutton.c
index 45412f28..c0a87455 100644
--- a/textscreen/txt_radiobutton.c
+++ b/textscreen/txt_radiobutton.c
@@ -70,7 +70,11 @@ static int TXT_RadioButtonKeyPress(txt_widget_t *widget, int key)
if (key == KEY_ENTER || key == ' ')
{
- *radiobutton->variable = radiobutton->value;
+ if (*radiobutton->variable != radiobutton->value)
+ {
+ *radiobutton->variable = radiobutton->value;
+ TXT_EmitSignal(widget, "selected");
+ }
return 1;
}