diff --git a/gb.gtk/src/CMenu.cpp b/gb.gtk/src/CMenu.cpp index 1152654dc..e5177af06 100644 --- a/gb.gtk/src/CMenu.cpp +++ b/gb.gtk/src/CMenu.cpp @@ -429,6 +429,16 @@ BEGIN_PROPERTY(Menu_Window) END_PROPERTY +BEGIN_PROPERTY(Menu_Parent) + + if (MENU->isTopLevel()) + GB.ReturnNull(); + else + GB.ReturnObject(GetObject(MENU->parentMenu())); + +END_PROPERTY + + BEGIN_PROPERTY(Menu_Name) if (READ_PROPERTY) @@ -530,6 +540,7 @@ GB_DESC CMenuDesc[] = GB_PROPERTY("Value", "b", Menu_Value), //GB_PROPERTY("TearOff", "b", CMENU_tear_off), GB_PROPERTY("Action", "s", Menu_Action), + GB_PROPERTY_READ("Parent", "Menu", Menu_Parent), GB_PROPERTY_READ("Window", "Window", Menu_Window), GB_PROPERTY("Proxy", "Menu", Menu_Proxy), diff --git a/gb.qt4/src/CMenu.cpp b/gb.qt4/src/CMenu.cpp index eb9845f0f..3903f5e91 100644 --- a/gb.qt4/src/CMenu.cpp +++ b/gb.qt4/src/CMenu.cpp @@ -834,6 +834,15 @@ BEGIN_PROPERTY(Menu_Window) END_PROPERTY +BEGIN_PROPERTY(Menu_Parent) + + if (CMENU_is_toplevel(THIS)) + GB.ReturnNull(); + else + GB.ReturnObject(THIS->parent); + +END_PROPERTY + BEGIN_PROPERTY(Menu_Action) char *current = THIS_EXT ? THIS_EXT->action : NULL; @@ -944,6 +953,7 @@ GB_DESC CMenuDesc[] = GB_PROPERTY("Radio", "b", Menu_Radio), GB_PROPERTY("Value", "b", Menu_Value), GB_PROPERTY("Action", "s", Menu_Action), + GB_PROPERTY_READ("Parent", "Menu", Menu_Parent), GB_PROPERTY_READ("Window", "Window", Menu_Window), GB_PROPERTY("Proxy", "Menu", Menu_Proxy),