Re: #52434 - Lock accelerators by default



On 7 May 2001, Havoc Pennington wrote:

 Hi, 

 I'm sorry for my ignorance - but how or whether will the user be able to
unlock accelerators beside recompiling the app? I think that there should be
some ways.
 

> 
> Can we get this patch in? Comments?
> 
> Havoc
> 
> Owen Taylor <otaylor redhat com> writes:
> > I took a quick look at this bug - the idea being that accelerators
> > should only be changeable for menu items if the entity creating
> > the menu item wants them to be changeable.
> > 
> > Changing gtkwidget.c so accelerators are locked by default
> > is easy enough - patch appended.
> > 
> > However this isn't quite right because we don't really want
> > prevent the accelerators on the widget being changed programatically,
> > just from being changed by the user.
> > 
> > I think the right thing to do might be to change things so:
> > 
> >  a) gtk_widget_add_accelerator/remove_accelerator() ignore the
> >     locked flag and always work.
> > 
> >  b) gtkmenu.c explicitely checks the locked flag (already does so) 
> >     before changing an accelerator.
> > 
> >  c) gtkmenu.c checks to see if there are any locked accelerators with
> >     the same key before setting the accelerator on a widget to avoid
> >     removing accelerators that you can't add back.  (Requires a small
> >     GtkAccelGroup API addition. Ugly, yes, but internally ugly)
> > 
> > c) is not all that important, IMO, since I think having a mix of
> > changeable and non-changeable accelerators on the same toplevel
> > is pretty broken. But its a corner case we probably should handle.
> > 
> > Anyways, I think you might have said you had some interest in working
> > on this, so if that's the case, I'll let you decide what we should
> > do. Just thought I'd throw out my thoughts since I spent a bit of time
> > looking on it.
> > 
> > Regards,
> >                                         Owen
> > 

 Best regards,
  -Vlad





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