New menuitem 'does not exist'

I added a new menuitem to a menu and when let the application run, an error appears ‘This item does not exist’.
I checked with every other menuitem, can’t see a difference. An IDE bug?

What happens if you delete it and run the app again?

It works as before, normally.

Maybe you accidentally renamed something? If you use a scroll-wheel mouse then that happens easily …

Okay, it’s my mouse’ fault then…?!!
Anybody else some good ideas?

What is the name of the new menu item?
Copy that.
Delete the menu item
Then search your project for the text you just copied.

Can you show the line(s) of code ?

[quote=374672:@Peter Kronenberg]Okay, it’s my mouse’ fault then…?!!
Anybody else some good ideas?[/quote]

I’m out… :confused:

When you add a new MenuHandler, you have to either (this is a ComboBox) type the name of the MenuItem or choose it from the List (click in the black triangle).

Go there and click in that black triangle: if you hve an entry that looks like the MenuHandler you add, choose it, and run.

OK, I have to recap: I’m not a beginner, and I have added for over 10 years menuitems to menues in my applications. Just this time, it does not recognize the new one. I’m using Xojo 2017 Rel 3.
Thats what I did:

  • in the menu bar under a menu ‘MenuWindow’ added a new item ‘MenuWindowOpen’.
  • added the menu handler WindowMenuOpen with code ‘WindowMain.Show’
  • in ‘Enablemenuitems’ added code 'MenuWindowOpen.Text = ‘Oeffnen’ -> this line creates the error ‘This item does not exist’
    Now there are other menu items just like that, and it works fine…
    I tried to delete that menu item again: but it does not (just deletes the name). Some time ago, I had a similar problem, when I duplicated a menu bar and I had several strange happenings, with missing and not existing items. Thats why I assume a bug, so is it one, and is there a way to get around it?

I was able to get the same behavior you describe.

Xojo 2017r3
El Capitan (with last updates)
Run in the IDE

Nota: my project have a button with code in the main window.

MenuWindowOp +Tab[/code] autocomplete to [code]MenuWindowOpen
MenuWindowOpen.Tex  +Tab[/code] autocomplete to [code]MenuWindowOpen.Text

Note:
I do not saved the project changes,
I was able to delete the changes (New Menu, New MenuItem, New Menu Handler)…

I quit Xojo without saving the changes to my Project.

BTW: Peter, you do not say the OS name/version.

At last, the advice I gave earlier is one I follow when I feel something strange happens (and sometimes I had a bad reference typing…

Ok guys, I investigated a bit an here what I found it myself:

• Deleting a menu item: do not select the menu item name to your left (content, blue), trying to delete it just deletes the menu item name (ID) in the edit field. The menu bar itself must be selected, then on the center preview area select the menu item text (turns blue) and then it can be deleted.
(Seems to me not so intuitive, Mr. Xojo…)
• My trouble itself: somehow my menu item MenuWindowOpen had an Index value of 0, I’m not aware I put it there, maybe when trying to move it / copying it / delete it (or was it indeed my mouse?) it was added by the IDE…? When clearing that field, the ‘does not exist’ does not come up anymore!
(In the Language reference it stated: The number of the selected MenuItem when it is part of an array. Never seen a menu item in an array, so why is that index needed anyway?)

Thanks for your help in any way.