|author||Guy Harris <email@example.com>||2000-07-07 07:01:58 +0000|
|committer||Guy Harris <firstname.lastname@example.org>||2000-07-07 07:01:58 +0000|
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
@@ -1,7 +1,7 @@
* 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 <email@example.com>
@@ -47,26 +47,33 @@ void destroy_packet_wins(void);
* Progress (modal) dialog box routines.
+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);