I am cleaning up GnomeAppHelper to be saner and support more stuff as well.  Right now you can create menus that are not attached to an app window (gnome_app_fill_menu).  You can also have underlined shortcut keys in the menus and hot keys that actually work.
I am cleaning up GnomeAppHelper to be saner and support more stuff as
well.  Right now you can create menus that are not attached to an app
window (gnome_app_fill_menu).  You can also have underlined shortcut
keys in the menus and hot keys that actually work.

For example, you can do this:

	static GnomeUIInfo file_menu[] = {
		{ GNOME_APP_UI_ITEM, "_New", "Create a new file", new_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'n', GDK_CONTROL_MASK, NULL },
		{ GNOME_APP_UI_ITEM, "_Open...", "Open an existing file", open_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, 'o', GDK_CONTROL_MASK, NULL },
		{ GNOME_APP_UI_ITEM, "_Save", "Save the current file", save_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 's', GDK_CONTROL_MASK, NULL },
		{ GNOME_APP_UI_ITEM, "Save _as...", "Save the current file with a new name", save_as_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE_AS, 0, 0, NULL },

		GNOMEUIINFO_SEPARATOR,

		{ GNOME_APP_UI_ITEM, "_Print...", "Print the current file", print_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PRINT, 'p', GDK_CONTROL_MASK, NULL },

		GNOMEUIINFO_SEPARATOR,

		{ GNOME_APP_UI_ITEM, "_Close", "Close the current file", close_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE, 0, 0, NULL },
		{ GNOME_APP_UI_ITEM, "E_xit", "Exit the program", exit_callback, NULL, NULL,
		  GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, 'q', GDK_CONTROL_MASK, NULL },
		GNOMEUIINFO_END
	};

	static GnomeUIInfo main_menu[] = {
		GNOMEUIINFO_SUBTREE ("_File", file_menu),
		GNOMEUIINFO_END
	};

The menu items will have underlined accelerafors.  You can use Alt-F
to open the File menu.  The hotkeys will also work. i.e. hit C-o for
Open.

Tomorrow I'll finish sanitizing the toolbar and popup menu code.

People who maintain language bindings may want to revise this -- a
parameter was removed from the GnomeUISignalConnectFunc type.
"Normal" users should not have problems with this.

It would be good if people would put underlined accelerators and
hotkeys in their applications.  Later I will put the canonical
information in the UI Guidelines document so that people can use it as
a reference.

  - Federico


1998-09-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gnome-app-helper.c (gnome_app_fill_menu
	gnome_app_fill_menu_custom): New public functions that are a
	rewrite of the menu creation code in GnomeAppHelper.  These are
	saner versions with additional goodies, like working accelerators,
	underlined shortcuts, sanity checks, etc.
	(gnome_app_create_menus):
	(gnome_app_create_menus_interp):
	(gnome_app_create_menus_with_data):
	(gnome_app_create_menus_custom): Made these functions use the new
	fill_menu code.
	The toolbar code still needs sanitizing; will do that tomorrow.

	* gnome-app-helper.h: Beautification and documentation of the
	header file.
	(GnomeUISignalConnectFunc): Removed the app parameter to functions
	of this type, as it is not needed or used.  Please make the
	appropriate changes to your language bindings and such.

	* gnome-app-helper.c: Added a little TODO list.

	* gnome-popupmenu.c: #ifdef'ed out the function bodies, since
	gnome-popupmenu is completely broken and needs rewriting.

	* gnome-canvas.c: Updates to the TODO list.

	* gnome-preferences.c (gnome_preferences_get_menus_have_icons
	gnome_preferences_set_menus_have_icons): New public functions to
	get/set whether menu items have icons in them.
	(gnome_preferences_load): Load the menus_have_icons parameter.
	(gnome_preferences_save): Save the menus_have_icons parameter.

	* gnome-rootwin.c (gnome_rootwin_expose): Return FALSE.

	* gnome-app.c: Added g_return_* sanity checks where they were missing.
	(gnome_app_set_contents): Fix the case where contents == NULL.

	* gnome-app.h: Added some comments/documentation.
	(struct _GnomeApp) Added an accel_group field -- this is the accel
	group where the window's hotkeys live.

	* gnome-app.c (gnome_app_init): Create the app window's accel
	group and attach it.

	* gnome-app.c (get_orientation): Added a small warning if the
	orientation is not matched.

1998-09-15  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* libgnome/gnome-metadata.c: Fixed some compiler warnings.

1998-09-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* testgnome.c (create_app_helper): Added a test for the new
	GnomeAppHelper stuff.

Distrotech/libgnomecanvas,Distrotech/libgnomecanvas,Distrotech/libgnomecanvas