RE: accelerators vs key_press_event



Hi,
 
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.
 
Regards,
 
-- 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
http://mail.gnome.org/archives/gtk-perl-list/2005-September/msg00188.html
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?

Jeff
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list




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