I have a large Xojo app where the main window of type Window contains a PagePanel with many controls of type DesktopListBox. I have been developing and running the app for months on Mac and Windows, but today the DragReorderRows event stopped firing in all DesktopListBox controls in the main window on Mac, but still fires in DesktopListBox controls in other windows. Everything still works fine on the Windows OS including the main window. If I add a new DesktopListBox control to our main window, the DragReorderRows also fires fine on Mac.
The IDE is Xojo 2022R3.1 running on macOS. Can DesktopListBox controls on Mac get corrupted and if so how can they be fixed?
Last Xojo is 2022R4.1, check if the problem exists in the latest version.
If yes, make a small sample to prove the problem and submit a case with the sample asking for a fix.
If not, just use 2022r4.1
Unfortunately, the issue cannot be demonstrated with a small sample since the event triggers fine. In fact, newly added DesktopListBox controls added to the same Window (that contains the bad controls) also work fine. Switching to a newer Xojo edition isn’t an option until a show stopper IDE bug is fixed.
So you should submit your app, under NDA to them, private. And tests will occur using the latest one. And if found a problem, a fix will be released in a next release.
Maybe something got mixed up internally. For a total shot in the dark try copying the entire contents of your DragReorderRows event (do not copy the event handler from the navigator), delete the event handler, re-add the handler, paste everything back in. Would be a totally wild fix if it works (and means that something got broken internally with your change to Desktop controls).
And a even more wild one would be, make a backup, create a new temporary DesktopWindow, create a new DesktopListBox there, set its properties from the ground up as the current broken one, create the events, past the codes. Delete the old ListBox in the previous window, drag the new one there (same name). Delete the temporary window. See if it works.
I tried deleting and re-adding the event handler, but that didn’t fix it. It got me thinking, so I copied that DesktopListBox to a tiny project and it works. Next I deleted the DesktopListBox from my big project and copied the one from my tiny project back into the big project and now it is fixed.
I not sure what triggered the initial problem, but the workaround seems to be to copy and paste the entire DesktopListBox to another project and back. Next I will try to repeat this workaround on the other broken DesktopListBox controls.
I have discovered that the copy and paste workaround does fix the DragReorderRows event firing on some DesktopListBox controls, it did not fix others.
When applying the copy and paste workaround, I have found that all of the DesktopListBox controls work when pasted into the Tiny app, but some still fail when pasted back into the Big app. When the DragReorderRows event fails to fire you notice the bold line with small circle at the left is not displayed for user feedback when the user presses the mouse over that list item.
Next I completely deleted a DesktopListBox control that could not be fixed via the workaround. I added the event handlers again and pasted in the code and DragReorderRows event now works. However, when I tried to fix a second DesktopListBox control using this more drastic approach, it still fails.
If you have been using source control, consider doing a diff on the Listbox that worked to see what changed.
After several attempts at deleting the DesktopListBox, adding the event handlers and pasting in the code, that final DesktopListBox started working again. It stayed working for several builds. I then made the “mistake” of slightly moving that DesktopListBox in the IDE editor and now the DragReorderRows event stopped firing again. After several more attempts at deleting and creating the DesktopListBox control, I have never got it to work again.
I think the root problem has something to do with a DesktopListBox in a GroupBox that resides on a PagePanel.