From 252846d7208bde0c7f6af3598393f3fa6695cb37 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 8 Feb 2008 13:59:37 +0000 Subject: [PATCH] Now the buttons have names like: button-1, button-2, etc. --- src/jinete/jalert.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jinete/jalert.c b/src/jinete/jalert.c index 86039c567..277920137 100644 --- a/src/jinete/jalert.c +++ b/src/jinete/jalert.c @@ -55,11 +55,16 @@ #include #include +#include #include "jinete/jinete.h" static JWidget create_alert(char *buf, JList *labels, JList *buttons); +/* creates a new alert-box + + the buttons will have names like: button-1, button-2, etc. + */ JWidget jalert_new(const char *format, ...) { JList labels, buttons; @@ -173,9 +178,13 @@ static JWidget create_alert(char *buf, JList *labels, JList *buttons) jlist_append(*labels, ji_separator_new(NULL, JI_HORIZONTAL)); } else if (button) { + char button_name[256]; JWidget button_widget = jbutton_new(beg); jwidget_set_min_size(button_widget, 60, 0); jlist_append(*buttons, button_widget); + + usprintf(button_name, "button-%d", jlist_length(*buttons)); + jwidget_set_name(button_widget, button_name); } buf[c] = chr;