Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Gtk+/Gnome Application Development
Prev Home Next

Convenience Routines

Since message boxes almost always have the same button (a single "OK"), there are convenience routines covering that case. Each routine has a _parented() variant which calls gnome_dialog_set_parent(). The three function pairs in Figure 11 display an info box, a warning box, and an error box, respectively; they create and show the widget, so you can ignore the return value if you like.

The only purpose of these functions is to save you typing. They are pure syntactic sugar. I find it much easier to remember them than to use gnome_message_box_new(), though; I always forget the order of the arguments to gnome_message_box_new().

     #include <libgnomeui/gnome-dialog-util.h>

GtkWidget* gnome_ok_dialog(const gchar* message);

GtkWidget* gnome_ok_dialog_parented(const gchar* message, GtkWindow* parent);

GtkWidget* gnome_warning_dialog(const gchar* warning);

GtkWidget* gnome_warning_dialog_parented(const gchar* warning, GtkWindow* parent);

GtkWidget* gnome_error_dialog(const gchar* error);

GtkWidget* gnome_error_dialog_parented(const gchar* error, GtkWindow* parent);

Figure 11. Convenience Dialogs

Gtk+/Gnome Application Development
Prev Home Next

  Published under free license. Design by Interspire