I created a base class and converted all my Windows to DesktopWindows. But when I try to run the app in the debugger, I get errors concerning the menu conversion. I saved the app as a xojo_project and found two lines in the source that I have tried modifying without success. When I try to run the app, the error message is
Type mismatch error. Expected class DesktopMenuBar, but got class DesktopMainMenuBar.DesktopMainMenuBar
245184511
The two lines in SoCal2.xojo_project with MenuBar in them are:
Load the project in the IDE and right click on the MenuBar and choose Convert to api2 from the context menu.
Desktop windows can only use DesktopMenus and old Windows can only use MenuBars.
Always use the ide to perform the conversions. Donāt try and do it by hand. Methods, events etc differ between APIs. Convert will make these changes for you.
Did you use the āConvert to DesktopMenuItemā for the contextual menu for MainMenuBar?
The conversion does not change the name of the menu, but change the MenuItems to DesktopMenuItems.
If AppMenuBar uses MainMenuBar, then you may need to convert the App section to DesktopApplication
Edit: MainMenuBar before conversion
#tag Menu
Begin Menu MainMenuBar
Begin MenuItem FileMenu
MainMenuBar after conversion
#tag Menu
Begin Menu MainMenuBar
Begin DesktopMenuItem FileMenu
Revert to the original menu and convert that in one go.
DesktopMenuBarās can only contain DesktopMenuItems, The whole thing need to be converted in one go. Do the conversion in the IDE sidebar of the MenuBar, not in the Window. I wouldnāt even try and convert the system outside of the IDE.