Index: trunk/src/hid_cfg.c =================================================================== --- trunk/src/hid_cfg.c (revision 1510) +++ trunk/src/hid_cfg.c (revision 1511) @@ -36,7 +36,7 @@ char hid_cfg_error_shared[1024]; -lht_node_t *hid_cfg_create_menu(hid_cfg_t *hr, const char *path_, const char *action, const char *mnemonic, const char *accel, const char *tip) +lht_node_t *hid_cfg_create_menu(hid_cfg_t *hr, const char *path_, const char *action, const char *mnemonic, const char *accel, const char *tip, lht_node_t **out_parent) { lht_node_t *parent, *new_sub; char *name, *path = strdup(path_); @@ -56,6 +56,9 @@ parent = hid_cfg_get_menu(hr, path); } + if (out_parent != NULL) + *out_parent = parent; + new_sub = hid_cfg_create_hash_node(parent, name, "m", mnemonic, "a", accel, "tip", tip, ((action != NULL) ? "action": NULL), action, NULL); if (action == NULL) Index: trunk/src/hid_cfg.h =================================================================== --- trunk/src/hid_cfg.h (revision 1510) +++ trunk/src/hid_cfg.h (revision 1511) @@ -33,7 +33,7 @@ /* Create a set of resources representing a single menu item If action is NULL, it's a drop-down item that has submenus. */ -lht_node_t *hid_cfg_create_menu(hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip); +lht_node_t *hid_cfg_create_menu(hid_cfg_t *hr, const char *path, const char *action, const char *mnemonic, const char *accel, const char *tip, lht_node_t **out_parent); /* Search and load the menu res for hidname; if not found, and embedded_fallback is not NULL, parse that string instead. Returns NULL on error */