path: root/ui_util.h
diff options
authorGuy Harris <guy@alum.mit.edu>2000-07-07 07:01:58 +0000
committerGuy Harris <guy@alum.mit.edu>2000-07-07 07:01:58 +0000
commit4e69c6bc87deb47b14112c781f33d07e7acb4ced (patch)
tree2c450d9fe5913a609caed9dec005ae46073df7f6 /ui_util.h
parent96c86d737aa7fba9b21991f96394a3f464aceb31 (diff)
Use "progdlg_t *" rather than "void *" as the handle for a progress
dialog box; that lets us do some type-checking, but we can still typedef it to an incompletely-defined structure to hide the implementation details from the caller. Make "create_progress_dlg()" take, as an argument, the title to put in the "stop the operation" button, and use "Stop" rather than "Cancel" if stopping the operation doesn't undo all the work it's done. Thaw the clist if we break out of a "read the file" operation, as we freeze it before the operation. Have the handler for the "delete" event on the progress dialog box return FALSE, to let GTK+ know that it should, in fact, delete the window. ("delete" event handlers should return TRUE if the window shouldn't actually be deleted, FALSE if it should; they should not return "void".) svn path=/trunk/; revision=2120
Diffstat (limited to 'ui_util.h')
1 files changed, 16 insertions, 9 deletions
diff --git a/ui_util.h b/ui_util.h
index 2b4585e014..ebc66e3f11 100644
--- a/ui_util.h
+++ b/ui_util.h
@@ -1,7 +1,7 @@
/* ui_util.h
* Definitions for UI utility routines
- * $Id: ui_util.h,v 1.5 2000/07/03 08:35:42 guy Exp $
+ * $Id: ui_util.h,v 1.6 2000/07/07 07:01:28 guy Exp $
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -47,26 +47,33 @@ void destroy_packet_wins(void);
* Progress (modal) dialog box routines.
+struct progdlg;
+typedef struct progdlg progdlg_t;
- * Create and pop up the progress dialog; return a pointer to it, as
- * a "void *", so that our caller doesn't have to know the GUI
- * implementation.
+ * Create and pop up the progress dialog; allocate a "progdlg_t"
+ * and initialize it to contain all information the implementation
+ * needs in order to manipulate the dialog, and return a pointer to
+ * it.
* The first argument is the title to give the dialog box; the second
- * argument is a pointer to a Boolean variable that will be set to
- * TRUE if the user hits the "Cancel" button.
+ * argument is the string to put in the "stop this operation" button;
+ * the third argument is a pointer to a Boolean variable that will be
+ * set to TRUE if the user hits that button.
-void *create_progress_dlg(gchar *title, gboolean *stop_flag);
+progdlg_t *create_progress_dlg(const gchar *title, const gchar *stop_title,
+ gboolean *stop_flag);
* Set the percentage value of the progress bar.
-void update_progress_dlg(void *dlg, gfloat percentage);
+void update_progress_dlg(progdlg_t *dlg, gfloat percentage);
* Destroy the progress bar.
-void destroy_progress_dlg(void *dlg);
+void destroy_progress_dlg(progdlg_t *dlg);
#ifdef __cplusplus