[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Accel Paths not being created?
- From: Daniel Pekelharing <legendstar gmail com>
- To: Gtk-App-Devel-List <gtk-app-devel-list gnome org>
- Subject: Re: Accel Paths not being created?
- Date: Fri, 02 Dec 2005 18:00:32 +0200
On Fri, 2005-12-02 at 14:15 +0200, Daniel Pekelharing wrote:
> Hi all,
>
> After my earlier queries regarding adjustable accelerator keys,
> I have been attempting to implement accelerator paths in my app.
>
> I'm using gtk_menu_set_accel_path on each toplevel menu I create,
> which should automatically assign paths to it's sub items..
>
> e.g. gtk_menu_set_accel_path(GTK_MENU(menu), "<main>/File");
> is supposed to result in a sub item "New" being assigned the path:
> "<main>/File/New"
>
> Only it doesn't seem to happen?
> Calling gtk_accel_map_lookup_entry("<main>/File/New", NULL);
> always returns false..
> even gtk_accel_map_lookup_entry("<main>/File", NULL);
> is returning false.
>
> I guess I must be doing something wrong, am I supposed to initialize the
> root path first somehow?
> I can't seem to find any info on whether the whole "accelerator path
> system" needs some sort of initialization.
>
> Any ideas anyone?
>
> Thanks!
Some further experimentation:
GtkWidget *menu, *file, *test;
menu = gtk_menu_new();
file = gtk_menu_item_new_with_label("File");
gtk_menu_item_set_submenu(GTK_MENU_ITEM(file), menu);
test = gtk_menu_item_new_with_label("test");
gtk_menu_shell_append(GTK_MENU_SHELL(menu), test);
gtk_menu_item_set_accel_path(GTK_MENU_ITEM(test), "<test>/File/test");
if (gtk_accel_map_lookup_entry("<test>/File/test", NULL))
printf("Accel path found!\n");
else printf("Accel path not found\n");
Is there any reason the call to gtk_accel_map_lookup_entry should be
returning false?
As thats what its doing...
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]