forked from AuroraMiddleware/gtk
0ceb0db081
2003-09-18 Matthias Clasen <maclas@gmx.de> Install accelerators on actions, not on proxies, support accelerator-only actions: * gtk/gtkmenu.c (get_accel_path): New function to get the accel path and its lock status either via _gtk_widget_get_accel_path() or by looking at the accel_path stored in the menu item itself and determining its lock status by peeking into the contained accel label. This was already (accidentally) committed a week ago. * gtk/gtkaction.h (gtk_action_set_accel_group): (gtk_action_[dis]connect_accelerator): New functions. * gtk/gtkaction.c (struct _GtkActionPrivate): Add accel_group, accel_closure and accel_count. We must have a reference to the accel_group, since we need it in connect_proxy. The count is necessary to ensure that the accelerator isn't removed before the last proxy requesting it has been unmerged. (connect_proxy): Connect the accelerator to the action now, only set the accel_path on the menuitem. (remove_proxy): Disconnect the accelerator from the action, not from the menuitem. (gtk_action_set_accel_group): Set the accel group. (gtk_action_[dis]connect_accelerator): Count the number of times this functions have been called and install/remove the accelerator if the count leaves/reaches zero. * gtk/gtkuimanager.h (GtkUIManagerItemType): Add GTK_UI_MANAGER_ACCELERATOR. * gtk/gtkuimanager.c (NodeType): Add NODE_TYPE_ACCELERATOR. (start_element_handler): Create NODE_TYPE_ACCELERATOR nodes from <accelerator> elements. (gtk_ui_manager_add_ui): Create NODE_TYPE_ACCELERATOR nodes when type is GTK_UI_MANAGER_ACCELERATOR. (update_node): Set the accel group on actions before creating their proxies. Don't set the accel group on created menus. For NODE_TYPE_ACCELERATOR nodes, [dis]connect the actions' accelerator. (print_node): Also emit <accelerator> elements. * tests/testmerge.c (dump_accels): Add a "Dump Accels" button. |
||
---|---|---|
.. | ||
gdk | ||
gdk-pixbuf | ||
gtk | ||
.cvsignore | ||
AUTHORS | ||
ChangeLog | ||
COPYING | ||
Makefile.am | ||
README | ||
README.cvs-commits |
This package contains the reference documentation for GTK+. For more information about GTK+ see: http://www.gtk.org For information about contributing to the GLib/GTK+ reference documentation project, see: http://www.gtk.org/rdp/ The GTK+ reference documentation is freely redistributable, see the file COPYING for details. REQUIREMENTS ============ To build the documentation, you must have the gtk-doc package installed. To rebuild the template files, you must have the current version of the GTK+ header files installed. BUILD ===== First, run configure to generate the makefiles for this module. There is one option specific to this package --with-html-dir=DIR top of installed HTML documentation tree The Makefiles in the gdk/ and gtk/ subdirs each define three targets: templates: Scan the headers and merge the results with the current template files sgml: Generate SGML files using the DocBook DTD from the template files html: Generate HTML from the SGML files. To build the documentation, do: make sgml make html You should only run the 'make templates' step if you need to regenerate the templates for a more recent version of the GTK+ sources. INSTALLATION ============ make install