]> Pileus Git - ~andy/gtk/commitdiff
Export gtk_widget_set_accel_path().
authorOwen Taylor <otaylor@redhat.com>
Wed, 30 Jan 2002 03:32:13 +0000 (03:32 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 30 Jan 2002 03:32:13 +0000 (03:32 +0000)
Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export
        gtk_widget_set_accel_path().

        * gtk/gtk.def: Add gtk_widget_set_accel_path.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtk.def
gtk/gtkitemfactory.c
gtk/gtkmenuitem.c
gtk/gtkwidget.c
gtk/gtkwidget.h

index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 1bbd881f7b8bba96c3cb9625d63ee8374cd8ec17..b7c752cbbcfd37a6a649f3dc8a8ce7ffafd02a3b 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jan 29 22:31:07 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.[ch] gtkmenuitem.c gtkitemfactory.c: Export 
+       gtk_widget_set_accel_path().
+
+       * gtk/gtk.def: Add gtk_widget_set_accel_path.
+
 Tue Jan 29 21:50:28 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkaccelmap.[ch] gtk/gtkbindings.[ch] gtk/gtkwidget.[ch]:
index 0989149d3a2a65a0c8ace209bf82b74878baa75e..455289b065cf315f3ff5e6b2befd81a4194f3cbc 100755 (executable)
@@ -2047,6 +2047,7 @@ EXPORTS
        gtk_widget_ref
        gtk_widget_region_intersect
        gtk_widget_remove_accelerator
+        gtk_widget_set_accel_path
        gtk_widget_render_icon
        gtk_widget_reparent
        gtk_widget_reset_rc_styles
index d47715371e60ea82ce39e851e51a2f2ce2cbe1fb..732c514561cd7bcf4ea9d8fdab54fe514213323d 100644 (file)
@@ -326,7 +326,7 @@ gtk_item_factory_add_foreign (GtkWidget      *accel_widget,
       if (accel_group)
        {
          gtk_accel_map_add_entry (full_path, keyval, modifiers);
-         _gtk_widget_set_accel_path (accel_widget, full_path, accel_group);
+         gtk_widget_set_accel_path (accel_widget, full_path, accel_group);
        }
     }
 }
index 85369a24fc7c2d50df587dbf51eb48fa970a7920..083358e989c8b72b1eb5da02a75f530f77601c40 100644 (file)
@@ -1054,7 +1054,7 @@ _gtk_menu_item_refresh_accel_path (GtkMenuItem   *menu_item,
 
   if (!accel_group)
     {
-      _gtk_widget_set_accel_path (widget, NULL, NULL);
+      gtk_widget_set_accel_path (widget, NULL, NULL);
       return;
     }
 
@@ -1074,10 +1074,10 @@ _gtk_menu_item_refresh_accel_path (GtkMenuItem   *menu_item,
          path = menu_item->accel_path;
        }
       if (path)
-       _gtk_widget_set_accel_path (widget, path, accel_group);
+       gtk_widget_set_accel_path (widget, path, accel_group);
     }
   else if (group_changed)                      /* reinstall accelerators */
-    _gtk_widget_set_accel_path (widget, path, accel_group);
+    gtk_widget_set_accel_path (widget, path, accel_group);
 }
 
 /**
@@ -1092,6 +1092,10 @@ _gtk_menu_item_refresh_accel_path (GtkMenuItem   *menu_item,
  * gtk_accel_map_add_entry() with the same @accel_path.
  * See also gtk_accel_map_add_entry() on the specifics of accelerator paths,
  * and gtk_menu_set_accel_path() for a more convenient variant of this function.
+ *
+ * This function is basically a convenience wrapper that handles calling
+ * gtk_widget_set_accel_path() with the appropriate accelerator group for
+ * the menu item.
  */
 void
 gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
@@ -1109,7 +1113,7 @@ gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
   menu_item->accel_path = g_strdup (accel_path);
 
   /* forget accelerators associated with old path */
-  _gtk_widget_set_accel_path (widget, NULL, NULL);
+  gtk_widget_set_accel_path (widget, NULL, NULL);
 
   /* install accelerators associated with new path */
   if (widget->parent)
index aa664e6350e928718aef4f7537ce759405303703..755ae1b25ac099338ded7c41810eca657e47dce3 100644 (file)
@@ -2593,14 +2593,14 @@ widget_new_accel_closure (GtkWidget *widget,
  * @accel_mods:   modifier key combination of the accelerator
  * @accel_flags:  flag accelerators, e.g. %GTK_ACCEL_VISIBLE
  *
- * Installs an accelerator for this @widget in @accel_group, that causes
+ * Installs an accelerator for this @widget in @accel_group that causes
  * @accel_signal to be emitted if the accelerator is activated.
  * The @accel_group needs to be added to the widget's toplevel via
  * gtk_window_add_accel_group(), and the signal must be of type %G_RUN_ACTION.
  * Accelerators added through this function are not user changeable during
  * runtime. If you want to support accelerators that can be changed by the
- * user, use gtk_accel_map_add_entry() and gtk_menu_item_set_accel_path()
- * instead.
+ * user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or
+ * gtk_menu_item_set_accel_path() instead.
  */
 void
 gtk_widget_add_accelerator (GtkWidget      *widget,
@@ -2743,15 +2743,35 @@ destroy_accel_path (gpointer data)
   g_free (apath);
 }
 
-/* accel_group: the accel group used to activate this widget
- * accel_path:  the accel path, associating the accelerator
- *              to activate this widget
- * set accel path through which this widget can be actiavated.
- */
+
+/**
+ * gtk_widget_set_accel_path:
+ * @widget: a #GtkWidget
+ * @accel_path: path used to look up the the accelerator
+ * @accel_group: a #GtkAccelGroup.
+ * 
+ * Given an accelerator group, @accel_group, and an accelerator path,
+ * @accel_path, sets up an accelerator in @accel_group so whenever the
+ * key binding that is defined for @accel_path is pressed, @widget
+ * will be activated.  This removes any accelerators (for any
+ * accelerator group) installed by previous calls to
+ * gtk_widget_set_accel_path(). Associating accelerators with
+ * paths allows them to be modified by the user and the modifications
+ * to be saved for future use. (See gtk_accel_map_save().)
+ *
+ * This function is a low level function that would most likely
+ * be used by a menu creation system like #GtkItemFactory. If you
+ * use #GtkItemFactory, setting up accelerator paths will be done
+ * automatically.
+ *
+ * Even when you you aren't using #GtkItemFactory, if you only want to
+ * set up accelerators on menu items gtk_menu_item_set_accel_path()
+ * provides a somewhat more convenient interface.
+ **/
 void
-_gtk_widget_set_accel_path (GtkWidget     *widget,
-                           const gchar   *accel_path,
-                           GtkAccelGroup *accel_group)
+gtk_widget_set_accel_path (GtkWidget     *widget,
+                          const gchar   *accel_path,
+                          GtkAccelGroup *accel_group)
 {
   AccelPath *apath;
 
index cc449f292326285a00263cf2d7c07567fac97bb1..d70a0ef67621fba39b266db36e883700d339266e 100644 (file)
@@ -488,7 +488,7 @@ gboolean   gtk_widget_remove_accelerator  (GtkWidget           *widget,
                                           GtkAccelGroup       *accel_group,
                                           guint                accel_key,
                                           GdkModifierType      accel_mods);
-void         _gtk_widget_set_accel_path   (GtkWidget           *widget,
+void       gtk_widget_set_accel_path      (GtkWidget           *widget,
                                           const gchar         *accel_path,
                                           GtkAccelGroup       *accel_group);
 const gchar* _gtk_widget_get_accel_path   (GtkWidget           *widget);