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



Narayana Pattipati <narayana pattipati wipro com> writes: 
>   '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.
> 

There are two problems here:

 - if you change the setting while the app is running, it does not
   take effect
 - you need to be looking at whether menus are locked on a per-menu 
   basis, maybe Owen knows which function you need for that

So I think you need to use the strategy where a binding set signal
returns a boolean.when it should be ignored. GtkPaned does things this
way. You want to return FALSE if the menu allows changes.

I believe you will need to add a new signal to GtkMenuShell for this,
since we made a mistake and did not have the existing signals return
boolean values.

Havoc



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