Commit 9df00746 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

add default icon

2001-08-28  Havoc Pennington  <hp@pobox.com>

	* demos/gtk-demo/main.c (setup_default_icon): add default icon

	* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
	warning fix
	(gtk_radio_button_new_with_label): warning fix

	* gtk/gtkdnd.c: used some random GtkImage private structs,
	update to reflect GtkImage changes

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
	whether the hint is supported, just always set the icon. A task
	list might want to use it even if the WM doesn't, and the WM may
	change over time. Also, XDeleteProperty() if list == NULL.

	* gtk/gtkwindow.c (gtk_window_set_icon_list)
	(gtk_window_get_icon_list)
	(gtk_window_set_icon)
	(gtk_window_get_icon)
	(gtk_window_set_default_icon_list)
	(gtk_window_get_default_icon_list):
	new functions

	* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet

	* gtk/gtkimage.c: Implement property support, bug #59408

	* gtk/gtkcontainer.c (gtk_container_add): make the warning message
	on reparent-without-removing-first a bit more helpful.
	Let's just destroy this FAQ.
parent 3921a791
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
2001-08-28 Havoc Pennington <hp@pobox.com>
* demos/gtk-demo/main.c (setup_default_icon): add default icon
* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
warning fix
(gtk_radio_button_new_with_label): warning fix
* gtk/gtkdnd.c: used some random GtkImage private structs,
update to reflect GtkImage changes
* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
whether the hint is supported, just always set the icon. A task
list might want to use it even if the WM doesn't, and the WM may
change over time. Also, XDeleteProperty() if list == NULL.
* gtk/gtkwindow.c (gtk_window_set_icon_list)
(gtk_window_get_icon_list)
(gtk_window_set_icon)
(gtk_window_get_icon)
(gtk_window_set_default_icon_list)
(gtk_window_get_default_icon_list):
new functions
* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet
* gtk/gtkimage.c: Implement property support, bug #59408
* gtk/gtkcontainer.c (gtk_container_add): make the warning message
on reparent-without-removing-first a bit more helpful.
Let's just destroy this FAQ.
Tue Aug 28 21:37:11 2001 Matthias Clasen <matthiasc@poet.de>
* demos/gtk-demo/appwindow.c (do_appwindow): Use g_signal_connect_object
......
......@@ -722,6 +722,58 @@ create_tree (void)
return tree_view;
}
static void
setup_default_icon (void)
{
GdkPixbuf *pixbuf;
/* Try in current directory, in case we haven't yet been installed
* (would be wrong in a real app)
*/
pixbuf = gdk_pixbuf_new_from_file ("./gtk-logo-rgb.gif", NULL);
if (pixbuf == NULL)
{
GError *err;
err = NULL;
pixbuf = gdk_pixbuf_new_from_file (DEMOCODEDIR"/gtk-logo-rgb.gif",
&err);
/* Ignoring this error (passing NULL instead of &err above)
* would probably be reasonable for most apps. We're just
* showing off.
*/
if (err)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Failed to read icon file "DEMOCODEDIR"/gtk-logo-rgb.gif: %s",
err->message);
g_error_free (err);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
}
}
if (pixbuf)
{
GList *list;
list = NULL;
list = g_list_append (list, pixbuf);
gtk_window_set_default_icon_list (list);
g_list_free (list);
g_object_unref (G_OBJECT (pixbuf));
}
}
int
main (int argc, char **argv)
{
......@@ -744,6 +796,8 @@ main (int argc, char **argv)
/* -- End of hack -- */
gtk_init (&argc, &argv);
setup_default_icon ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "GTK+ Code Demos");
......
......@@ -793,6 +793,7 @@ Windows
@window:
@pixbufs:
<!-- # Unused Parameters # -->
@Returns:
......
......@@ -953,6 +953,14 @@ produce superscript and subscript.
</para>
<!-- ##### ENUM GtkTreeSelectionMode ##### -->
<para>
</para>
@GTK_TREE_SELECTION_SINGLE:
@GTK_TREE_SELECTION_MULTI:
<!-- ##### ARG GtkVScale:adjustment ##### -->
<para>
the #GtkAdjustment which sets the range of the scale.
......@@ -1034,6 +1042,12 @@ If the window shrinks automatically when widgets within it shrink.
</para>
<!-- ##### ARG GtkWindow:icon-list ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_arg_copy ##### -->
<para>
It will either copy data into an existing argument or allocate a new argument
......
......@@ -181,3 +181,13 @@ there is actually a #GtkLabel inside of the #GtkButton.
The #GtkReliefStyle as outlined in gtk_button_set_relief().
</para>
<!-- ##### ARG GtkButton:use-underline ##### -->
<para>
</para>
<!-- ##### ARG GtkButton:use-stock ##### -->
<para>
</para>
......@@ -278,3 +278,53 @@ Gets the GtkImage
@mask: a GDKBitmap that indicates which parts of the image should be transparent.
<!-- ##### ARG GtkImage:pixbuf ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:pixmap ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:image ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:mask ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:file ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:stock ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:icon-set ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:icon-size ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:pixbuf-animation ##### -->
<para>
</para>
<!-- ##### ARG GtkImage:storage-type ##### -->
<para>
</para>
......@@ -44,10 +44,11 @@ Adds a new #GtkMenuItem to the end of the GtkMenuBar
Adds a new #GtkMenuItem to the beginning of the GtkMenuBar
</para>
@menu_child:
@menu:
@child: the #GtkMenuItem to add
<!-- # Unused Parameters # -->
@menu_child:
@menu_bar: a #GtkMenuBar
@child: the #GtkMenuItem to add
<!-- ##### MACRO gtk_menu_bar_insert ##### -->
......
......@@ -131,7 +131,7 @@ Emits the "activate" signal on the given item
@allocation:
<!-- ##### FUNCTION gtk_menu_item_right_justify ##### -->
<!-- ##### MACRO gtk_menu_item_right_justify ##### -->
<para>
Sets the menu item to be right-justified. Only useful for menu bars.
</para>
......
......@@ -14,14 +14,6 @@ GtkTreeSelection
</para>
<!-- ##### ENUM GtkTreeSelectionMode ##### -->
<para>
</para>
@GTK_TREE_SELECTION_SINGLE:
@GTK_TREE_SELECTION_MULTI:
<!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
<para>
......
......@@ -549,3 +549,8 @@ The position of the window.
</para>
<!-- ##### ARG GtkWindow:icon ##### -->
<para>
</para>
......@@ -444,7 +444,7 @@ GdkEventMask gdk_window_get_events (GdkWindow *window);
void gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask);
gboolean gdk_window_set_icon_list (GdkWindow *window,
void gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs);
void gdk_window_set_icon (GdkWindow *window,
GdkWindow *icon_window,
......
......@@ -2325,7 +2325,6 @@ gdk_window_set_override_redirect (GdkWindow *window,
* gdk_window_set_icon_list:
* @window: The #GdkWindow toplevel window to set the icon of.
* @pixbufs: A list of pixbufs, of different sizes.
* @Returns: %TRUE if the icons were set, false otherwise
*
* Sets a list of icons for the window. One of these will be used
* to represent the window when it has been iconified. The icon is
......@@ -2335,12 +2334,8 @@ gdk_window_set_override_redirect (GdkWindow *window,
* image quality since the window manager may only need to scale the
* icon by a small amount or not at all.
*
* On the X11 backend this call might fail if the window manager
* doesn't support the Extended Window Manager Hints. Then this
* function returns FALSE, and the application should fall back
* to #gdk_window_set_icon().
**/
gboolean
void
gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs)
{
......@@ -2354,14 +2349,10 @@ gdk_window_set_icon_list (GdkWindow *window,
gint x, y;
gint n_channels;
g_return_val_if_fail (window != NULL, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return FALSE;
if (!gdk_net_wm_supports (gdk_atom_intern ("_NET_WM_ICON", FALSE)))
return FALSE;
return;
l = pixbufs;
size = 0;
......@@ -2418,14 +2409,21 @@ gdk_window_set_icon_list (GdkWindow *window,
l = g_list_next (l);
}
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE),
XA_CARDINAL, 32,
PropModeReplace,
(guchar*) data, size);
return TRUE;
if (size > 0)
{
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE),
XA_CARDINAL, 32,
PropModeReplace,
(guchar*) data, size);
}
else
{
XDeleteProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_atom_intern ("_NET_WM_ICON", FALSE));
}
}
void
......
......@@ -23,6 +23,11 @@
gtk_requisition_free
"sizeof(GtkRequisition)")
(define-boxed GtkIconSet
gtk_icon_set_ref
gtk_icon_set_unref
"sizeof(GtkIconSet)")
;; TextView
(define-boxed GtkTextIter
......
......@@ -858,7 +858,8 @@ gtk_container_add (GtkContainer *container,
if (widget->parent != NULL)
{
g_warning ("Attempting to add a widget with type %s to a container of "
"type %s, but the widget is already inside a container of type %s",
"type %s, but the widget is already inside a container of type %s, "
"the GTK+ FAQ at http://www.gtk.org/faq/ explains how to reparent a widget.",
g_type_name (G_OBJECT_TYPE (widget)),
g_type_name (G_OBJECT_TYPE (container)),
g_type_name (G_OBJECT_TYPE (widget->parent)));
......
......@@ -78,6 +78,7 @@ struct _GtkDragSourceSite
GtkImagePixbufData pixbuf;
GtkImageStockData stock;
} icon_data;
GdkBitmap *icon_mask;
GdkColormap *colormap; /* Colormap for drag icon */
......@@ -1941,8 +1942,8 @@ gtk_drag_source_unset_icon (GtkDragSourceSite *site)
case GTK_IMAGE_PIXMAP:
if (site->icon_data.pixmap.pixmap)
gdk_pixmap_unref (site->icon_data.pixmap.pixmap);
if (site->icon_data.pixmap.mask)
gdk_pixmap_unref (site->icon_data.pixmap.mask);
if (site->icon_mask)
gdk_pixmap_unref (site->icon_mask);
break;
case GTK_IMAGE_PIXBUF:
g_object_unref (G_OBJECT (site->icon_data.pixbuf.pixbuf));
......@@ -1999,7 +2000,7 @@ gtk_drag_source_set_icon (GtkWidget *widget,
site->icon_type = GTK_IMAGE_PIXMAP;
site->icon_data.pixmap.pixmap = pixmap;
site->icon_data.pixmap.mask = mask;
site->icon_mask = mask;
site->colormap = colormap;
}
......@@ -2683,7 +2684,7 @@ gtk_drag_source_event_cb (GtkWidget *widget,
gtk_drag_set_icon_pixmap (context,
site->colormap,
site->icon_data.pixmap.pixmap,
site->icon_data.pixmap.mask,
site->icon_mask,
-2, -2);
break;
case GTK_IMAGE_PIXBUF:
......
This diff is collapsed.
......@@ -57,13 +57,11 @@ typedef struct _GtkImageAnimationData GtkImageAnimationData;
struct _GtkImagePixmapData
{
GdkPixmap *pixmap;
GdkBitmap *mask;
};
struct _GtkImageImageData
{
GdkImage *image;
GdkBitmap *mask;
};
struct _GtkImagePixbufData
......@@ -74,13 +72,11 @@ struct _GtkImagePixbufData
struct _GtkImageStockData
{
gchar *stock_id;
GtkIconSize size;
};
struct _GtkImageIconSetData
{
GtkIconSet *icon_set;
GtkIconSize size;
};
struct _GtkImageAnimationData
......@@ -116,6 +112,12 @@ struct _GtkImage
GtkImageIconSetData icon_set;
GtkImageAnimationData anim;
} data;
/* Only used with GTK_IMAGE_PIXMAP, GTK_IMAGE_IMAGE */
GdkBitmap *mask;
/* Only used with GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET */
GtkIconSize icon_size;
};
struct _GtkImageClass
......
......@@ -220,7 +220,7 @@ gtk_radio_button_new_with_label (GSList *group,
radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, NULL) ;
if (group)
gtk_radio_button_set_group (radio_button, group);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
return radio_button;
}
......@@ -246,7 +246,7 @@ gtk_radio_button_new_with_mnemonic (GSList *group,
radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, "use_underline", TRUE, NULL);
if (group)
gtk_radio_button_set_group (radio_button, group);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
return radio_button;
}
......
......@@ -64,7 +64,7 @@ enum {
/* Construct */
PROP_TYPE,
/* Style Props */
/* Normal Props */
PROP_TITLE,
PROP_ALLOW_SHRINK,
PROP_ALLOW_GROW,
......@@ -74,10 +74,21 @@ enum {
PROP_DEFAULT_WIDTH,
PROP_DEFAULT_HEIGHT,
PROP_DESTROY_WITH_PARENT,
PROP_ICON,
LAST_ARG
};
typedef struct
{
GList *icon_list;
GdkPixmap *icon_pixmap;
GdkPixmap *icon_mask;
guint realized : 1;
guint using_default_icon : 1;
guint using_parent_icon : 1;
} GtkWindowIconInfo;
typedef struct {
GdkGeometry geometry; /* Last set of geometry hints we set */
GdkWindowHints flags;
......@@ -217,11 +228,17 @@ static void gtk_window_set_default_size_internal (GtkWindow *window,
gboolean change_height,
gint height);
static void gtk_window_realize_icon (GtkWindow *window);
static void gtk_window_unrealize_icon (GtkWindow *window);
static GSList *toplevel_list = NULL;
static GHashTable *mnemonic_hash_table = NULL;
static GtkBinClass *parent_class = NULL;
static guint window_signals[LAST_SIGNAL] = { 0 };
static GList *default_icon_list = NULL;
/* FIXME need to be per-screen */
static GdkPixmap *default_icon_pixmap = NULL;
static GdkPixmap *default_icon_mask = NULL;
static void gtk_window_set_property (GObject *object,
guint prop_id,
......@@ -349,7 +366,7 @@ gtk_window_class_init (GtkWindowClass *klass)
GTK_WINDOW_TOPLEVEL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
/* Style Props */
/* Regular Props */
g_object_class_install_property (gobject_class,
PROP_TITLE,
g_param_spec_string ("title",
......@@ -427,8 +444,14 @@ gtk_window_class_init (GtkWindowClass *klass)
FALSE,
G_PARAM_READWRITE));
/* Style props are set or not */
g_object_class_install_property (gobject_class,
PROP_ICON,
g_param_spec_object ("icon",
_("Icon"),
_("Icon for this window"),
GDK_TYPE_PIXBUF,
G_PARAM_READWRITE));
window_signals[SET_FOCUS] =
g_signal_new ("set_focus",
G_TYPE_FROM_CLASS (object_class),
......@@ -651,6 +674,11 @@ gtk_window_set_property (GObject *object,
case PROP_DESTROY_WITH_PARENT:
gtk_window_set_destroy_with_parent (window, g_value_get_boolean (value));
break;
case PROP_ICON:
gtk_window_set_icon (window,
g_value_get_object (value));
break;