Re: Unwanted behavior with menu item accelerators



On Wed, 20 Jun 2001 mulgund sandeep adlittle com wrote:

It seems as though my question has sparked some interesting debate on GUI
policies, which is great to see.  However, does anyone know the answer to
my original question?  How do you shut off GTK's "feature" of allowing user
definition of keyboard accelerators to menu items in a running program?

    GtkAccelGroup *accel = NULL;
...
    accel = gtk_accel_group_new(); /* make a new group */
...
    menubar = menubar_new(accel, stuff); /* make a menubar from item
factory */
...
    gtk_window_add_accel_group(GTK_WINDOW(window), accel);
...

    /* prevent idiots from changing shortcut keys */
    gtk_accel_group_lock(accel);

I am assuming you are making the menu from a GtkItemFactory, which takes a
accelgroup as one of the parameters. Then you can lock the accelgroup and
the problem is solved. I also agree with you that this is one of the worst
features of GTK.

tc

-- 
・‥…━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━…‥・
     timecop at japan.co.jp | OA通信サービス株式会社 | NTT DoCoMo
  I thought everything that Linus Torvalds is involved with was divine
  perfection? Must be a problem with NEC and Sony -about Crusoe recall
・‥…━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━…‥・





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