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

Hi Owen,

I am trying to implement Home/End key navigation for gtkoptionmenu. 
I have added a new signal for this purpose in gtkmenushell.c and
added a callback which returns Boolean value as suggested by Havoc
in the following discussion. I have to address the following issues

a) Since the source code for navigation is same for all the kinds 
   of menus(drop-down/popup etc), Home/End keynav is given for the 
   other kinds of menus also. Is it OK to have Home/End for all the
   If it is not correct, could you please suggest a way to address this

b) User can assign Home/End keys as dynamic key shorts. In that case,
   Home/End keynav should be disabled for the menus. In gtkmenu the
   property "gtk-can-change-accels" is defined. How do I dynamically
   verify whether this property is defined for any kind of menu.??
Could you please clarify the above doubts.

Havoc Pennington wrote:
> 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.
> 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
Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.

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