[monkey-bubble: 459/753] New function.



commit 2e8f8f4f95311d296cd083d5333e5e862abfd7f5
Author: Martin Baulig <baulig suse de>
Date:   Wed Jun 13 21:14:36 2001 +0000

    New function.
    
    2001-06-13  Martin Baulig  <baulig suse de>
    
    	* gnome-window.c (gnome_window_set_icon_from_default): New function.

 libgnomeui/ChangeLog      |    4 ++++
 libgnomeui/gnome-window.c |   20 ++++++++++++++++++++
 libgnomeui/gnome-window.h |    2 ++
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/libgnomeui/ChangeLog b/libgnomeui/ChangeLog
index 96afa6d..357b052 100644
--- a/libgnomeui/ChangeLog
+++ b/libgnomeui/ChangeLog
@@ -1,5 +1,9 @@
 2001-06-13  Martin Baulig  <baulig suse de>
 
+	* gnome-window.c (gnome_window_set_icon_from_default): New function.
+
+2001-06-13  Martin Baulig  <baulig suse de>
+
 	* Makefile.am: Install libgnomeui.h in `$(includedir)/gnome/2' to make it
 	consistent with Bonobo.
 
diff --git a/libgnomeui/gnome-window.c b/libgnomeui/gnome-window.c
index 4b21bb3..ca8bea0 100644
--- a/libgnomeui/gnome-window.c
+++ b/libgnomeui/gnome-window.c
@@ -31,6 +31,7 @@
 #include <gdk/gdkx.h>
 
 #include "gnome-window.h"
+#include "gnome-init.h"
 
 /**
  * gnome_window_toplevel_set_title:
@@ -162,3 +163,22 @@ gnome_window_set_icon_from_file (GtkWindow *window, const char *filename, gboole
     gnome_window_set_icon (window, pb, overwrite);
     gdk_pixbuf_unref (pb);
 }
+
+/**
+ * gnome_window_icon_set_from_default:
+ * @w: the #GtkWidget to set the icon on
+ *
+ * Description: Makes the #GtkWindow @w use the default icon.
+ */
+void
+gnome_window_set_icon_from_default (GtkWindow *w)
+{
+	GnomeProgram *program;
+	const gchar *default_icon = NULL;
+
+	program = gnome_program_get ();
+	g_object_get (G_OBJECT (program), LIBGNOMEUI_PARAM_DEFAULT_ICON, &default_icon);
+	if (default_icon)
+		gnome_window_set_icon_from_file (w, default_icon, FALSE);
+}
+
diff --git a/libgnomeui/gnome-window.h b/libgnomeui/gnome-window.h
index 5ef0dc8..9502f6f 100644
--- a/libgnomeui/gnome-window.h
+++ b/libgnomeui/gnome-window.h
@@ -38,6 +38,8 @@ void gnome_window_set_icon_from_file (GtkWindow *window,
 				      const char *filename,
 				      gboolean overwrite);
 
+void gnome_window_set_icon_from_default (GtkWindow *w);
+
 G_END_DECLS
 
 #endif /* GNOME_WINDOW_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]