Re: [gtk-list] Re: Problem with + and - keys in Tree widget



Owen Taylor wrote:
> 
> Preben Randhol <randhol@pvv.org> writes:
> 
> > The "normal" + and - keys do not work with the Tree widget to close
> > and open a branch. The + and - on the numerical pad does though.
> 
> I assume you mean thet CTree widget, since the Tree widget doesn't
> have keybindings.
> 
> > I have a normal keyboard with Norwegian layout and I'm using no-latin1
> > kbd setting. When I try in a GTk app to press +, nothing happens. If I
> > press - it works, but I guess that is coincidence.
> 
> The default bindings are a bit strange:
> 
>  + opens a branch
>  - closes a branch
>  = toggles a branch
> 
> Which of these don't work for you?
> 
> These are done by keysymbol, not by keycode, so the keyboard
> mapping shouldn't matter.

This is an americanism in the CTree widget.  On american keyboards the +
is shifted, on norvegian (and danish) keyboards it is not.  The same
goes for the = (toggle) binding.

The keyboard mapping doesn't matter, but the shift state does.  There
should be a way in gtk to specify a key binding to use if there is no
specific binding for the actual modifier state.

To fix it, take a look at the sources (gtk/gtkctree.c) and find the
bindings that bother you.  Search for "gtk_binding_entry_add_signal" to
find the right spot. Then duplicate the appropriate lines, so there are
bindings for + and = both with and without shift pressed. 

I posted a fix for the CTree widget to http://bugs.gnome.org/ on the
gtk+ wishlish.  I have never heard anything about it, though.  I have no
idea if the maintainers actually read the postings there.

-- 
René Seindal (rene@seindal.dk)			http://www.seindal.dk/rene/



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