Re: [g-a-devel]Clarification on gtkoptionmenu keynav.



Hi Havoc,

> Oh, I see. I think you can have your keybinding signal (the one you
> use to connect to the binding set) return a boolean value,
> FALSE indicates that the keybinding was ignored and the key should
> be passed through. So then you return FALSE if the menu supports
> dynamic accel changing.
> 
> I don't think you want the value of gtk-can-change-accels, rather you
> want the per-menu setting... I don't remember the function for that.

  'gtk-can-change-accels' property is defined in gtkmenu.c. I could find
out
  the flag which corresponds to this. Now what I did is to allow the 
  keybinding for Home/End keys only if the flag is FALSE. Is it OK if I 
  implement it this way. Now for all kinds of menus, 
  if the flag is FALSE, the Home/End keynav will be enabled.

  g_object_get (G_OBJECT (gtk_settings_get_default ()),
                "gtk-can-change-accels", &can_change_accels,
                NULL);
  if (!can_change_accels)
  {
    gtk_binding_entry_add_signal (binding_set,
                                GDK_Home, 0,
                                "move_current", 1,
                                GTK_TYPE_TOOLBAR_DIRECTION,
                                GTK_MENU_DIR_FIRST);
   .....
  }    

Please give your thoughts on this.

Regards,
Narayana.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]