Re: [gtk-list] Re: Setting accelerators in GtkItemFactoryEntry
- From: Jens Askengren <ebo000441 ktv eboab se>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Setting accelerators in GtkItemFactoryEntry
- Date: Mon, 4 Oct 1999 20:01:29 +0200 (MET DST)
On Mon, 4 Oct 1999, Daniel Hops wrote:
> Jens Askengren wrote:
> 
> > Is it possible to use keys as return, delete etc. as acceleratorkeys
> > in a GtkItemFactoryEntry? I have tried the obvious "<return>" and
> > "<delete>" but it doesen't seem to work.
> 
> Hi,
> 
> try s.th. like this:
> 
>  if( (event->keyval) == GDK_Return ){
>   main_find_product();
>  }
> 
That pice of code seems to belong in a key-press-event callback...
Ofcourse, thats a possible soultion, but it would be nicer to do
something like this:
static GtkItemFactoryEntry menu_items[] =
{
...
    { "/_List",              NULL,           0, 0,"<Branch>" },
    { "/List/_Add",          "<control>A",   on_add_activate,        0},
    { "/List/_Edit",         "<Return>",     on_edit_activate,       0},
    { "/List/_Delete",       "<delete>",     on_delete_activate,     0},
...                              ^
                                 |
                Don't work, and I can't find any documentation that states
                what strings are recogniced as accelerator keys.
-Jens
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]