ModalProgressDialog.h

Go to the documentation of this file.
00001 #ifndef MODALINFODIALOG_H_
00002 #define MODALINFODIALOG_H_
00003 
00004 #include <gtk/gtkwidget.h>
00005 #include <gtk/gtkwindow.h>
00006 
00007 #include <string>
00008 
00009 namespace gtkutil
00010 {
00015     class ModalProgressDialog
00016     {
00017             // Main dialog widget
00018             GtkWidget* _widget;
00019 
00020             // Label with info text
00021             GtkWidget* _label;
00022 
00023             // Progress bar
00024             GtkWidget* _progressBar;
00025 
00026         private:
00027 
00028             // GTK Callback to catch delete-event, to prevent destruction of the
00029             // window
00030             static gboolean _onDelete (GtkWidget* widget, gpointer data)
00031             {
00032                 return TRUE; // stop event
00033             }
00034 
00035             // Process the GTK events to ensure the progress bar/text is updated
00036             // on screen
00037             void handleEvents ();
00038 
00039         public:
00040 
00044             ModalProgressDialog (GtkWindow* parent, const std::string& title);
00045 
00048             ~ModalProgressDialog ()
00049             {
00050                 gtk_widget_destroy(_widget);
00051             }
00052 
00055             void setText (const std::string& text);
00056     };
00057 }
00058 
00059 #endif /*MODALINFODIALOG_H_*/

Generated by  doxygen 1.6.2