Re: [gtk-list] Re: Underline menu Characters
- From: Damon Chaplin <damon karuna freeserve co uk>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Underline menu Characters
- Date: Thu, 24 Jun 1999 21:19:17 +0100
Edward March wrote:
>
> 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 ?
I've added support for this to Glade today, so it will be in Glade 0.5.1
which will be available at the weekend.
Here's some example output:
menubar1 = gtk_menu_bar_new ();
gtk_object_set_data (GTK_OBJECT (window1), "menubar1", menubar1);
gtk_widget_show (menubar1);
gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
file1 = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (file1)->child),
_("_File"));
gtk_widget_add_accelerator (file1, "activate_item", accel_group,
tmp_key, GDK_MOD1_MASK, 0);
gtk_object_set_data (GTK_OBJECT (window1), "file1", file1);
gtk_widget_show (file1);
gtk_container_add (GTK_CONTAINER (menubar1), file1);
file1_menu = gtk_menu_new ();
file1_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (file1_menu));
gtk_object_set_data (GTK_OBJECT (window1), "file1_menu", file1_menu);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (file1), file1_menu);
new1 = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (new1)->child),
_("_New"));
gtk_widget_add_accelerator (new1, "activate_item", file1_menu_accels,
tmp_key, 0, 0);
gtk_object_set_data (GTK_OBJECT (window1), "new1", new1);
gtk_widget_show (new1);
gtk_container_add (GTK_CONTAINER (file1_menu), new1);
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]