+2008-02-25 Sven Herzberg <sven@imendio.com>
+
+ Fixed: MB#1221: HildonWindow shouldn't call show_all for GtkMenu
+
+ * doc/Makefile.am: tell gtk-doc about HILDON_DISABLE_DEPRECATED
+ * examples/hildon-window-menu-example.c: (main): explicitly show
+ the menu item
+ * src/hildon-window.c:
+ (hildon_window_set_main_menu): moved most of the code from set_menu()
+ to this place; skipped the call to gtk_widget_show_all(); also didn't
+ introduce gtk_widget_show() as gtk_menu_popup() will call that anyways
+ (hildon_window_set_menu): removed most of the code, just keep the
+ questionable gtk_widget_show_all()
+ * src/hildon-window.h: added the new function and deprecate the old
+ one
+
2008-01-10 Xan Lopez <xan.lopez@nokia.com>
[2.0.1-1 release]
GtkMenu *menu = GTK_MENU (gtk_menu_new ());
GtkWidget *menu_item = gtk_menu_item_new_with_label ("Test item");
+ gtk_widget_show (menu_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- hildon_window_set_menu (HILDON_WINDOW (window), menu);
+ hildon_window_set_main_menu (HILDON_WINDOW (window), menu);
g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show_all (GTK_WIDGET (window));
}
/**
- * hildon_window_set_menu:
+ * hildon_window_set_main_menu:
* @self: A #HildonWindow
* @menu: The #GtkMenu to be used for this #HildonWindow
*
* Sets the menu to be used for this window. This menu overrides
* a program-wide menu that may have been set with
- * hildon_program_set_common_menu. Pass NULL to remove the current
- * menu. HildonWindow takes ownership of the passed menu and you're
+ * hildon_program_set_common_menu(). Pass %NULL to remove the current
+ * menu. #HildonWindow takes ownership of the passed menu and you're
* not supposed to free it yourself anymore.
+ *
+ * Since: Hildon 2.2
**/
void
-hildon_window_set_menu (HildonWindow *self,
- GtkMenu *menu)
+hildon_window_set_main_menu (HildonWindow* self,
+ GtkMenu * menu)
{
HildonWindowPrivate *priv;
gtk_widget_set_name (priv->menu, "menu_force_with_corners");
gtk_menu_attach_to_widget (GTK_MENU (priv->menu), GTK_WIDGET (self), &detach_menu_func);
g_object_ref (GTK_MENU (priv->menu));
- gtk_widget_show_all (GTK_WIDGET (priv->menu));
}
}
/**
+ * hildon_window_set_menu:
+ * @self: A #HildonWindow
+ * @menu: The #GtkMenu to be used for this #HildonWindow
+ *
+ * Sets the menu to be used for this window. This menu overrides
+ * a program-wide menu that may have been set with
+ * hildon_program_set_common_menu. Pass NULL to remove the current
+ * menu. HildonWindow takes ownership of the passed menu and you're
+ * not supposed to free it yourself anymore.
+ *
+ * Note: hildon_window_set_menu() calls gtk_widget_show_all() for the
+ * #GtkMenu. To pass control about visibility to the application
+ * developer, hildon_window_set_main_menu() was introduced, which
+ * doesn't do this.
+ *
+ * Deprecated: Hildon 2.2: use hildon_window_set_main_menu()
+ **/
+void
+hildon_window_set_menu (HildonWindow *self,
+ GtkMenu *menu)
+{
+ HildonWindowPrivate *priv;
+
+ g_return_if_fail (HILDON_IS_WINDOW (self));
+
+ hildon_window_set_main_menu (self, menu);
+
+ priv = HILDON_WINDOW_GET_PRIVATE (self);
+
+ if (priv->menu != NULL)
+ gtk_widget_show_all (GTK_WIDGET (priv->menu));
+}
+
+/**
* hildon_window_get_is_topmost:
* @self: A #HildonWindow
*