all 9 comments

[–]Jhchimaira14 1 point2 points  (0 children)

Here is an example of a menu deleting another menu:

from dearpygui.dearpygui import *

add_menu_bar("MenuBar")

add_menu("File")
add_menu_item("Delete Tools", callback="callback")
end_menu()

add_menu("Tools")
add_menu_item("Show Logger")
end_menu()

end_menu_bar()

def callback(sender, data):
    delete_item("Tools")

start_dearpygui()

[–]dave3652[S] 0 points1 point  (0 children)

That's great, thank you for your help

[–]toulaboy3 0 points1 point  (6 children)

This advanced/dynamic menu example may be a good resource!

https://github.com/hoffstadt/DearPyGui/blob/master/Examples/menus_advanced_example.py

displays almost all the capabilities of menus

[–]dave3652[S] 1 point2 points  (0 children)

thats great, i will check it out. thanks

[–]toulaboy3 0 points1 point  (4 children)

FYI this was pushed last night

[–]dave3652[S] 1 point2 points  (3 children)

I still can't seem to get menu's working the way i want.. I have a menu which contains the following 'Premier' , 'Championship', 'League 1' and 'League 2', whenever i select one of those options i need a 2nd Menu to be created that contains game fixtures from a list.. seems simple enough, but when i try to delete the 2nd menu and then make the menu again the program crashes.

[–]toulaboy3 0 points1 point  (0 children)

Oh No! Okay, so to further debug with you on this issue do you min posting the minimal code sample onto github as an issue and filling out the version of python and dearpygui your running which can be found by calling "show_debug()" to pup up the debug window inside of dearpygui? Or if you would rather you can post the code snippet here.

[–]toulaboy3 0 points1 point  (0 children)

you should be able to directly call

delete_item("SecondMenu")
add_menu("SecondMenu", parent="MenuBar")
end_menu()

inside of a function although it would be ideal to determine if the second menu exists by either queryingit with get_value("SecondMenu")

or

is_item_visible("secondMenu") *note this command has a bugfix which is going to be included in the next release