I am having a problem with iterating through my WindowMenu children.
I added the code for the XOJO example WindowMenu. This is found in Desktop/Windows
This will add to the WindowMenu links to active windows.
It is also supposed to remove inactive windows, but it doesn’t, because it can’t.
Part of the problem is MenuItem.Count. It doesn’t return a correct count of children.
The example has this code in EnableMenuItems, and is added to each window.
[code]Dim count As Integer
Dim w As WindowMenuItem
count = WindowMenu.Count - 1[/code]
For starters, I have 3 children here: WindowRestore, WindowNext, Window Previous. The count here for only MenuItems is 2 and not 3. Why?
To repeat, the count is 2.
I also have at least one WindowMenuItem in the list.
The current window has already been added, so when it gets EnableMenuItems, the menuItem is already there.
The count should be 4 including 1WindowMenuItem.
So how do I get to the menuItem WindowMenuItem if it isn’t there in the count?