Re: [gtk-list] Re: accelerators



On Wed, Apr 29, 1998 at 06:57:56PM -0500, robert havoc pennington wrote:
> > I want to bind the escape key to delete_event for Gnome dialogs; but the
> > accelerator functions seem to take characters, not keysyms. Is there a
> > character for escape? 
> 
> So I've tried '\x1b' and 27, and then tried using the letter a ('a'), but
> the accelerator doesn't do anything AFAICT. I push the key, nothing
> happens.
> 
> I have:
> 
>  dialog->accelerators = gtk_accelerator_table_new();
>   gtk_widget_install_accelerator(GTK_WIDGET(dialog),
> 				 dialog->accelerators,
> 				 "delete_event",
> 				 'a', 0);

You will also have to add the accelerator table to the window:

gtk_window_add_accelerator_table(GTK_WINDOW(dialog), dialog->accelerators);

> I have the same problem in 'gw,' none of the accelerators work; gw uses
> GnomeApp, so it ought to be automatic, right? But they do work in 'gtt',
> for example, and I can't see a difference in what's being done.  It's even
> the same key, control-Q; I even tried changing gw to use 'Q' instead of
> 'q' to match gtt. Clearly I'm missing something.

I added the code to add the accelerator table to the window in
gnome-app-helper. This should solve your problem there. After chasing this
bug, I have no clue, why gtt had working accelerators before. :-)

-- 
Eckehard Berns



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