1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GtkMenu
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2004-10-16 02:55:23 +00:00
|
|
|
A menu widget
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
A #GtkMenu is a #GtkMenuShell that implements a drop down menu consisting of
|
|
|
|
a list of #GtkMenuItem objects which can be navigated and activated by the
|
|
|
|
user to perform application functions.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A #GtkMenu is most commonly dropped down by activating a #GtkMenuItem in a
|
|
|
|
#GtkMenuBar or popped up by activating a #GtkMenuItem in another #GtkMenu.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A #GtkMenu can also be popped up by activating a #GtkOptionMenu.
|
|
|
|
Other composite widgets such as the #GtkNotebook can pop up a #GtkMenu
|
|
|
|
as well.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Applications can display a #GtkMenu as a popup menu by calling the
|
|
|
|
gtk_menu_popup() function. The example below shows how an application
|
|
|
|
can pop up a menu when the 3rd mouse button is pressed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<example>
|
|
|
|
<title>Connecting the popup signal handler.</title>
|
|
|
|
<programlisting>
|
|
|
|
/* connect our handler which will popup the menu */
|
2004-04-23 19:48:08 +00:00
|
|
|
g_signal_connect_swapped (window, "button_press_event",
|
|
|
|
G_CALLBACK (my_popup_handler), menu);
|
1999-08-16 18:51:52 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
|
|
|
|
<example>
|
|
|
|
<title>Signal handler which displays a popup menu.</title>
|
|
|
|
<programlisting>
|
|
|
|
static gint
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
my_popup_handler (GtkWidget *widget, GdkEvent *event)
|
1999-08-16 18:51:52 +00:00
|
|
|
{
|
|
|
|
GtkMenu *menu;
|
|
|
|
GdkEventButton *event_button;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
/* The "widget" is the menu that was supplied when
|
Small additions.
* gtk/tmpl/gtktextview.sgml: Small additions.
* gtk/tmpl/gtksignal.sgml: Explain what to use instead.
* gtk/question_index.sgml, gtk/text_widget.sgml, gtk/tree_widget.sgml,
gtk/changes-1.2.sgml, gtk/changes-2.0.sgml,
gtk/framebuffer.sgml: SGML fixes and additions.
* gtk/tmpl/gtksignal.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkeditable.sgml, gtk/tmpl/gtkfilesel.sgml,
gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkrc.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkwindow.sgml:
Replace references to deprecated functions.
2002-01-03 23:04:44 +00:00
|
|
|
* g_signal_connect_swapped() was called.
|
1999-08-16 18:51:52 +00:00
|
|
|
*/
|
|
|
|
menu = GTK_MENU (widget);
|
|
|
|
|
|
|
|
if (event->type == GDK_BUTTON_PRESS)
|
|
|
|
{
|
|
|
|
event_button = (GdkEventButton *) event;
|
|
|
|
if (event_button->button == 3)
|
|
|
|
{
|
|
|
|
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
|
|
|
|
event_button->button, event_button->time);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-06-10 04:46:16 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
<!-- ##### SECTION Image ##### -->
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### STRUCT GtkMenu ##### -->
|
|
|
|
<para>
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
The #GtkMenu struct contains private data only, and
|
1999-08-16 18:51:52 +00:00
|
|
|
should be accessed using the functions below.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### SIGNAL GtkMenu::move-scroll ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: the object which received the signal.
|
|
|
|
@arg1:
|
|
|
|
|
2008-07-05 20:30:16 +00:00
|
|
|
<!-- ##### ARG GtkMenu:accel-group ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:accel-path ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:active ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:attach-widget ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:monitor ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2009-07-07 05:05:29 +00:00
|
|
|
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:tearoff-title ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:bottom-attach ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:left-attach ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:right-attach ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:top-attach ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2009-01-01 22:24:56 +00:00
|
|
|
<!-- ##### ARG GtkMenu:arrow-placement ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:arrow-scaling ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2006-05-05 16:21:19 +00:00
|
|
|
<!-- ##### ARG GtkMenu:double-arrows ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### ARG GtkMenu:horizontal-offset ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-12-20 05:47:43 +00:00
|
|
|
<!-- ##### ARG GtkMenu:horizontal-padding ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### ARG GtkMenu:vertical-offset ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkMenu:vertical-padding ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_new ##### -->
|
|
|
|
<para>
|
|
|
|
Creates a new #GtkMenu.
|
|
|
|
</para>
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
@void:
|
1999-08-16 18:51:52 +00:00
|
|
|
@Returns: a new #GtkMenu.
|
|
|
|
|
|
|
|
|
2002-04-30 18:16:14 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_set_screen ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@screen:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_reorder_child ##### -->
|
|
|
|
<para>
|
|
|
|
Moves a #GtkMenuItem to a new position within the #GtkMenu.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@child: the #GtkMenuItem to move.
|
|
|
|
@position: the new position to place @child. Positions are numbered from
|
|
|
|
0 to n-1.
|
|
|
|
|
|
|
|
|
2003-10-24 22:16:07 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_attach ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@child:
|
|
|
|
@left_attach:
|
|
|
|
@right_attach:
|
|
|
|
@top_attach:
|
|
|
|
@bottom_attach:
|
|
|
|
|
|
|
|
|
2010-05-26 02:57:46 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_popup_for_device ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@device:
|
|
|
|
@parent_menu_shell:
|
|
|
|
@parent_menu_item:
|
|
|
|
@func:
|
|
|
|
@data:
|
2010-10-19 01:31:02 +00:00
|
|
|
@destroy:
|
2010-05-26 02:57:46 +00:00
|
|
|
@button:
|
|
|
|
@activate_time:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_popup ##### -->
|
|
|
|
|
Documentation fixes.
Sun Oct 13 18:50:14 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
gtktreemodel.sgml,gtktable.sgml, gtktable.c:
Documentation fixes.
#85719, #90759, #95169, Owen Taylor;
#89221, Yao Zhang, Matthias Clasen;
#95592, Joost Faassen;
#92637, Vitaly Tishkov;
#94616, Ben Martin;
#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
|
|
|
|
|
|
|
@menu:
|
|
|
|
@parent_menu_shell:
|
|
|
|
@parent_menu_item:
|
|
|
|
@func:
|
|
|
|
@data:
|
|
|
|
@button:
|
|
|
|
@activate_time:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_set_accel_group ##### -->
|
|
|
|
<para>
|
|
|
|
Set the #GtkAccelGroup which holds global accelerators for the menu.
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
This accelerator group needs to also be added to all windows that
|
|
|
|
this menu is being used in with gtk_window_add_accel_group(), in order
|
|
|
|
for those windows to support all the accelerators contained in this group.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@accel_group: the #GtkAccelGroup to be associated with the menu.
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_accel_group ##### -->
|
|
|
|
<para>
|
2001-10-28 21:15:36 +00:00
|
|
|
Gets the #GtkAccelGroup which holds global accelerators for the menu.
|
|
|
|
See gtk_menu_set_accel_group().
|
2000-09-07 18:17:06 +00:00
|
|
|
</para>
|
|
|
|
|
2001-10-28 21:15:36 +00:00
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@Returns: the #GtkAccelGroup associated with the menu.
|
2000-09-07 18:17:06 +00:00
|
|
|
|
|
|
|
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_set_accel_path ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@accel_path:
|
|
|
|
|
|
|
|
|
2008-07-22 00:39:10 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_accel_path ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_set_title ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-01-01 23:51:00 +00:00
|
|
|
@menu:
|
2001-12-27 20:22:16 +00:00
|
|
|
@title:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2008-09-04 16:56:51 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_title ##### -->
|
2001-09-08 06:24:46 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2008-09-04 16:56:51 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_set_monitor ##### -->
|
2001-09-08 06:24:46 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
2008-09-04 16:56:51 +00:00
|
|
|
@monitor_num:
|
2001-09-08 06:24:46 +00:00
|
|
|
|
|
|
|
|
2008-07-22 00:39:10 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_monitor ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2008-09-04 16:56:51 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_tearoff_state ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2009-07-07 05:05:29 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@reserve_toggle_size:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
|
|
|
|
<para>
|
|
|
|
Removes the menu from the screen.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_reposition ##### -->
|
|
|
|
<para>
|
|
|
|
Repositions the menu according to its position function.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_get_active ##### -->
|
|
|
|
<para>
|
|
|
|
Returns the selected menu item from the menu. This is used by the
|
|
|
|
#GtkOptionMenu.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@Returns: the #GtkMenuItem that was last selected in the menu. If a
|
|
|
|
selection has not yet been made, the first menu item is selected.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_set_active ##### -->
|
|
|
|
<para>
|
|
|
|
Selects the specified menu item within the menu. This is used by the
|
2002-02-22 00:26:54 +00:00
|
|
|
#GtkOptionMenu and should not be used by anyone else.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
2002-11-08 19:41:50 +00:00
|
|
|
@index_: the index of the menu item to select. Index values are from
|
1999-08-16 18:51:52 +00:00
|
|
|
0 to n-1.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_set_tearoff_state ##### -->
|
|
|
|
<para>
|
|
|
|
Changes the tearoff state of the menu. A menu is normally displayed
|
|
|
|
as drop down menu which persists as long as the menu is active. It can
|
|
|
|
also be displayed as a tearoff menu which persists until it is closed
|
|
|
|
or reattached.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
@torn_off: If %TRUE, menu is displayed as a tearoff menu.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_attach_to_widget ##### -->
|
|
|
|
<para>
|
|
|
|
Attaches the menu to the widget and provides a callback function that will
|
|
|
|
be invoked when the menu calls gtk_menu_detach() during its destruction.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@attach_widget: the #GtkWidget that the menu will be attached to.
|
|
|
|
@detacher: the user supplied callback function that will be called when
|
|
|
|
the menu calls gtk_menu_detach().
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_detach ##### -->
|
|
|
|
<para>
|
|
|
|
Detaches the menu from the widget to which it had been attached.
|
|
|
|
This function will call the callback function, @detacher, provided
|
|
|
|
when the gtk_menu_attach_to_widget() function was called.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_menu_get_attach_widget ##### -->
|
|
|
|
<para>
|
|
|
|
Returns the #GtkWidget that the menu is attached to.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@Returns: the #GtkWidget that the menu is attached to.
|
|
|
|
|
|
|
|
|
2004-05-11 04:32:13 +00:00
|
|
|
<!-- ##### FUNCTION gtk_menu_get_for_attach_widget ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@widget:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### USER_FUNCTION GtkMenuPositionFunc ##### -->
|
|
|
|
<para>
|
|
|
|
A user function supplied when calling gtk_menu_popup() which controls the
|
|
|
|
positioning of the menu when it is displayed. The function sets the @x
|
|
|
|
and @y parameters to the coordinates where the menu is to be drawn.
|
2009-05-31 03:26:37 +00:00
|
|
|
To make the menu appear on a different monitor than the mouse pointer,
|
|
|
|
gtk_menu_set_monitor() must be called.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@menu: a #GtkMenu.
|
|
|
|
@x: address of the #gint representing the horizontal position where the
|
|
|
|
menu shall be drawn. This is an output parameter.
|
|
|
|
@y: address of the #gint representing the vertical position where the
|
|
|
|
menu shall be drawn. This is an output parameter.
|
2007-10-01 18:21:54 +00:00
|
|
|
@push_in: This parameter controls how menus placed outside the monitor are handled.
|
2009-03-25 03:47:15 +00:00
|
|
|
If this is set to %TRUE and part of the menu is outside the monitor then
|
2007-10-01 18:21:54 +00:00
|
|
|
GTK+ pushes the window into the visible area, effectively modifying the
|
|
|
|
popup position.
|
|
|
|
Note that moving and possibly resizing the menu around will alter the
|
|
|
|
scroll position to keep the menu items "in place", i.e. at the same monitor
|
|
|
|
position they would have been without resizing.
|
|
|
|
In practice, this behavior is only useful for combobox popups or option
|
2007-10-01 18:26:45 +00:00
|
|
|
menus and cannot be used to simply confine a menu to monitor boundaries.
|
|
|
|
In that case, changing the scroll offset is not desirable.
|
1999-08-16 18:51:52 +00:00
|
|
|
@user_data: the data supplied by the user in the gtk_menu_popup() @data
|
|
|
|
parameter.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GtkMenuDetachFunc ##### -->
|
|
|
|
<para>
|
|
|
|
A user function supplied when calling gtk_menu_attach_to_widget() which
|
|
|
|
will be called when the menu is later detached from the widget.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@attach_widget: the #GtkWidget that the menu is being detached from.
|
|
|
|
@menu: the #GtkMenu being detached.
|
|
|
|
|
|
|
|
|