]> Pileus Git - ~andy/gtk/commitdiff
Only a GtkMisc widget should be passed to gtk_tool_button_new()
authorJavier Jardón <jjardon@gnome.org>
Mon, 26 Apr 2010 18:05:51 +0000 (20:05 +0200)
committerJavier Jardón <jjardon@gnome.org>
Mon, 26 Apr 2010 18:23:39 +0000 (20:23 +0200)
Reported by Hernando Torque here:
https://bugzilla.gnome.org/show_bug.cgi?id=616851

gtk/gtktoolbutton.c

index a0e16b98edf1db60cdd7a79c3a6cc95b46c227ff..e8a6eca90eb30aa9b4f6af54a48a4ab7fe861b98 100644 (file)
@@ -928,7 +928,7 @@ gtk_tool_button_new_from_stock (const gchar *stock_id)
 /**
  * gtk_tool_button_new:
  * @label: (allow-none): a string that will be used as label, or %NULL
- * @icon_widget: (allow-none): a widget that will be used as icon widget, or %NULL
+ * @icon_widget: (allow-none): a #GtkMisc widget that will be used as icon widget, or %NULL
  *
  * Creates a new %GtkToolButton using @icon_widget as icon and @label as
  * label.
@@ -943,6 +943,8 @@ gtk_tool_button_new (GtkWidget       *icon_widget,
 {
   GtkToolButton *button;
 
+  g_return_val_if_fail (GTK_IS_MISC (icon_widget), NULL);
+
   button = g_object_new (GTK_TYPE_TOOL_BUTTON,
                          "label", label,
                          "icon-widget", icon_widget,