summaryrefslogtreecommitdiff
path: root/textscreen
diff options
context:
space:
mode:
Diffstat (limited to 'textscreen')
-rw-r--r--textscreen/txt_window_action.c14
-rw-r--r--textscreen/txt_window_action.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/textscreen/txt_window_action.c b/textscreen/txt_window_action.c
index aabae15b..5df08e3b 100644
--- a/textscreen/txt_window_action.c
+++ b/textscreen/txt_window_action.c
@@ -107,10 +107,24 @@ static void WindowAcceptCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(window))
TXT_WidgetKeyPress(window, KEY_ENTER);
}
+// An action with the name "close" the closes the window
+
txt_window_action_t *TXT_NewWindowEscapeAction(txt_window_t *window)
{
txt_window_action_t *action;
+ action = TXT_NewWindowAction(KEY_ESCAPE, "Close");
+ TXT_SignalConnect(action, "pressed", WindowCloseCallback, window);
+
+ return action;
+}
+
+// Exactly the same as the above, but the button is named "abort"
+
+txt_window_action_t *TXT_NewWindowAbortAction(txt_window_t *window)
+{
+ txt_window_action_t *action;
+
action = TXT_NewWindowAction(KEY_ESCAPE, "Abort");
TXT_SignalConnect(action, "pressed", WindowCloseCallback, window);
diff --git a/textscreen/txt_window_action.h b/textscreen/txt_window_action.h
index 80e1d3e5..57028b80 100644
--- a/textscreen/txt_window_action.h
+++ b/textscreen/txt_window_action.h
@@ -43,6 +43,10 @@ txt_window_action_t *TXT_NewWindowAction(int key, char *label);
txt_window_action_t *TXT_NewWindowEscapeAction(txt_window_t *window);
+// Same as above, but the button is named "abort"
+
+txt_window_action_t *TXT_NewWindowAbortAction(txt_window_t *window);
+
// Accept button that does nothing
txt_window_action_t *TXT_NewWindowAcceptAction(txt_window_t *window);