Re: [gtk-list] Re: Underline menu Characters




I want to underline my menu's 1st character... underscores wont
work in this example.

Im building my menus using glade0.4.1
and code looks like this:

  mFile = gtk_menu_item_new_with_label ("_File");
  gtk_object_set_data (GTK_OBJECT (TheFinder), "mFile", mFile);
  gtk_widget_show (mFile);
  gtk_container_add (GTK_CONTAINER (menubar1), mFile);               

	In this case the underline DOES not work any ideas on what
	I can do beside using MenuFactory ?


On Tue, 22 Jun 1999, Dave Reed wrote:

> > From: Edward March <emarch@enteract.com>
> > 
> > 	Hi How Do I under line the 'F' of the File Menu
> > 	Connecting a ALT+F to the File menu work, but I want 
> > 	To underline the F
> > 
> > 	Typicalls its '&File' or '^File' or '~File' isnt there some
> > 	special char to make it underline ? What is it -- Thanks 
> 
> 
> 
> Put an _ in front of the letter you want to underline and alt-letter
> will get you that menu.
> 
> Snippets from some of my code that demonstrate this:
> 
>   static GtkItemFactoryEntry menu_items[] =
>   {
>     { "/_File", NULL, 0, 0, "<Branch>" },
>     { "/File/_Save Image", "<control>S", file_save_cb, 0},
>     { "/File/tearoff1", NULL, NULL, 0, "<Tearoff>" },
>     { "/File/sep1", NULL, NULL, 0, "<Separator>" },
>     { "/File/_Quit", "<control>Q", file_quit_cb, 0},
>   };
> 
>  static int num_menu_items = sizeof (menu_items) / sizeof(menu_items[0]);
> 
> ...
> 
>   GtkAccelGroup *accel_group;
>   GtkItemFactory *item_factory;
> 
>   accel_group = gtk_accel_group_new ();
>   item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
>                                        accel_group);
>   gtk_item_factory_create_items (item_factory, num_menu_items,
>                                  menu_items, NULL);
>   gtk_accel_group_attach (accel_group, GTK_OBJECT (main_window_));
> 
> 
> Dave
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 



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