jlittle (12/9/2021)
Are you trying to "unregister" your own menu item or the already existing ones?
If the existing ones, why would want you do this?
If all you want to do is disable certain plugins then my "
Plugin Manger" will do that for you.
Once you "find" the main menu, you can then look at each of the menus child objects to "find" other menu items which then can be removed.
Jeff
i want to unregister my own plugin.
my initialisation it thus
def initialize_plugin():
# Add menu
ic_dlg = wrapInstance(int(RLPy.RUi.GetMainWindow()), QtWidgets.QMainWindow)
plugin_menu = ic_dlg.menuBar().findChild(QtWidgets.QMenu, "Platform_menu")
if (plugin_menu == None):
plugin_menu = wrapInstance(int(RLPy.RUi.AddMenu("Platform lights", RLPy.EMenu_Plugins)), QtWidgets.QMenu)
plugin_menu.setObjectName("Platform_menu")
platform_action = plugin_menu.addAction("Stages")
platform_action.triggered.connect(show_dialog)
despite this
when i unload or attempt to
def UnloadMe(toHandle):
# remove menu
ic_dlg = wrapInstance(int(RLPy.RUi.GetMainWindow()), QtWidgets.QMainWindow)
plugin_menu = ic_dlg.menuBar().findChild(QtWidgets.QMenu, "Platform_menu")
if (plugin_menu != None):
#lAction = plugin_menu.findChild(QtWidgets.QAction, "Stages")
for ThatActions in ic_dlg.actions():
print (ThatActions)
for TotherAction in plugin_menu.actions():
print (TotherAction)
returns nothing.
when you say "find the main menu" do you mean by interrogating the "ic_dlg" handle?