From: curt Date: Thu, 5 Sep 2002 21:58:24 +0000 (+0000) Subject: Erik Hofman: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6bcef49afcfd106ff7e930831b2c39989bd27bc0;p=flightgear.git Erik Hofman: It turned out that pui required the submenu structure to be declared backwards, which I didn't notice the first time. --- diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 7e3ffa875..f0e40a9a4 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -116,21 +116,22 @@ void initMenu() SGPropertyNode *call = option[i]->getNode("call"); SGPropertyNode *sep = option[i]->getNode("seperator"); + int pos = option.size()-i-1; if (sep) - Menu[h].submenu[i] = strdup("----------"); + Menu[h].submenu[pos] = strdup("----------"); else if (call && strcmp(call->getStringValue(), "")) - Menu[h].submenu[i] = strdup(name->getStringValue()); + Menu[h].submenu[pos] = strdup(name->getStringValue()); else - Menu[h].submenu[i] = strdup("not specified"); + Menu[h].submenu[pos] = strdup("not specified"); - Menu[h].cb[i] = NULL; + Menu[h].cb[pos] = NULL; for (unsigned int j=0; __fg_gui_fn[j].fn; j++) if (call && !strcmp(call->getStringValue(), __fg_gui_fn[j].name) ) { - Menu[h].cb[i] = __fg_gui_fn[j].fn; + Menu[h].cb[pos] = __fg_gui_fn[j].fn; break; } }