diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-01-29 23:07:17 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-01-29 23:07:17 +0000 |
commit | 419837e53154a82f09b29e2ee1467182c3c40c5d (patch) | |
tree | 35fb4e8188b7b5999add632a3116c75bb93e470d /simple_dialog.h | |
parent | e66b849e236a18eae60adb3c18d7b77560a3ab2e (diff) | |
download | wireshark-419837e53154a82f09b29e2ee1467182c3c40c5d.tar.gz |
added "Yes" and "No" buttons to the simple_dialog,
added a callback method, to be called if a button was pressed
svn path=/trunk/; revision=9907
Diffstat (limited to 'simple_dialog.h')
-rw-r--r-- | simple_dialog.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/simple_dialog.h b/simple_dialog.h index 4346eaa973..c57ddb2ea9 100644 --- a/simple_dialog.h +++ b/simple_dialog.h @@ -2,7 +2,7 @@ * Definitions for dialog box routines with toolkit-independent APIs but * toolkit-dependent implementations. * - * $Id: simple_dialog.h,v 1.4 2002/08/28 21:00:41 jmayer Exp $ + * $Id: simple_dialog.h,v 1.5 2004/01/29 23:07:17 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -35,22 +35,32 @@ extern "C" { #define ESD_TYPE_INFO 0x00 #define ESD_TYPE_WARN 0x01 #define ESD_TYPE_CRIT 0x02 +#define ESD_TYPE_QUEST 0x03 /* Flag to be ORed with the dialog type, to specify that the dialog is to be modal. */ -#define ESD_TYPE_MODAL 0x04 +#define ESD_TYPE_MODAL 0x10 /* Which buttons to display. */ -#define ESD_BTN_OK 0 -#define ESD_BTN_CANCEL 1 +#define ESD_BTN_OK 0x01 +#define ESD_BTN_CANCEL 0x02 +#define ESD_BTN_YES 0x04 +#define ESD_BTN_NO 0x08 +/* show a simple dialog */ #if __GNUC__ >= 2 -void simple_dialog(gint, gint *, gchar *, ...) +extern gpointer simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...) __attribute__((format (printf, 3, 4))); #else -void simple_dialog(gint, gint *, gchar *, ...); +extern gpointer simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...); #endif +/* callback function type */ +typedef void (* simple_dialog_cb_t) (gpointer dialog, gint btn, gpointer data); + +/* set the callback function, which has to be called when a button was pressed */ +extern void simple_dialog_set_cb(gpointer dialog, simple_dialog_cb_t callback_fct, gpointer data); + #ifdef __cplusplus } #endif /* __cplusplus */ |