RE: accelerators vs key_press_event

I have a similar problem. The main view of my application is a TextView, so I want copy / paste / delete / 
etc. to show in the menu with accelerators. However when I focus an Entry next to the TextView I want the 
copy / paste / delete to act upon that entry, not on the TextView.
One solution for this is to check the widget focus in the handler for the accelerator. But this is not 
satisfactory because now the toolbar buttons also only work with proper focus. Which results in a lot of 
reports about "buggy" behavior :( Since I use UIManager I can not distinguise between events from these 
toolbar buttons and key press events.
I would be quite happy to use key_press_event but still put the key binding as an accelerator in the menu.
My current solution is to make the menu items insensitive when the TextView loses focus - which is very ugly, 
but at least shows clearly what is happening to the user.
Any suggestion on how to fix this kind of problem are very welcome.
-- Jaap Karssenberg <pardus cpan org>


From: gtk-perl-list-bounces gnome org on behalf of Jeffrey Ratcliffe
Sent: Wed 4/25/2007 1:21 PM
To: gtk-perl-list gnome org
Subject: accelerators vs key_press_event

I would like to use Delete as an accelerator without affecting
TextView, etc.. Muppet explained in
that it was better to hook up an key_press_event than an accelerator,
but that then you lose the helpful accelerator hint in the menu.

How do I make people aware of the existence of the accelerator without
their reading the docs?

gtk-perl-list mailing list
gtk-perl-list gnome org

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