Commit 6c3e8747 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

menu button: Add popup/popdown functions

These are needed, after all.
parent 01879512
......@@ -1855,6 +1855,8 @@ gtk_menu_button_set_label
gtk_menu_button_get_label
gtk_menu_button_set_relief
gtk_menu_button_get_relief
gtk_menu_button_popup
gtk_menu_button_popdown
<SUBSECTION Standard>
GTK_TYPE_MENU_BUTTON
GTK_MENU_BUTTON
......
......@@ -1369,3 +1369,34 @@ gtk_menu_button_get_relief (GtkMenuButton *menu_button)
return gtk_button_get_relief (GTK_BUTTON (priv->button));
}
/**
* gtk_menu_button_popup:
* @menu_button: a #GtkMenuButton
*
* Pop up the menu.
*/
void
gtk_menu_button_popup (GtkMenuButton *menu_button)
{
GtkMenuButtonPrivate *priv = gtk_menu_button_get_instance_private (menu_button);
g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), TRUE);
}
/**
* gtk_menu_button_popdown:
* @menu_button: a #GtkMenuButton
*
* Dismiss the menu.
*/
void
gtk_menu_button_popdown (GtkMenuButton *menu_button)
{
GtkMenuButtonPrivate *priv = gtk_menu_button_get_instance_private (menu_button);
g_return_if_fail (GTK_IS_MENU_BUTTON (menu_button));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), FALSE);
}
......@@ -118,6 +118,12 @@ void gtk_menu_button_set_relief (GtkMenuButton *menu_button,
GDK_AVAILABLE_IN_ALL
GtkReliefStyle gtk_menu_button_get_relief (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_ALL
void gtk_menu_button_popup (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_ALL
void gtk_menu_button_popdown (GtkMenuButton *menu_button);
G_END_DECLS
#endif /* __GTK_MENU_BUTTON_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment