Has drag and drop (DragObjects) changed in Big Sur? I have a window where prior to Big Sur I could drag items between two list boxes. This is now broken. The drag item is being properly identified and added in the DragRow event but after that things break down. Seems like something has changed…
You’re talking about PrivateData or something else?
What are you seeing? A crash, code that won’t execute, empty string values, kernel panic, Earth exploding?
I don’t use Big Sur that much, but the actual behaviour may be examined, I guess.
So first to answer @Arnaud_N - this is code that has worked great for the last couple of years until now. The drag object never leaves the first listbox. It exists as I see it being created when I step through the code. So dragging it elsewhere doesn’t do anything. I tried. I
And @Beatrix_Willius, I haven’t had the time yet to prepare an example. That is my plan.
It is possible that I could have inadvertently done something to break this functionality which as I say was working. I know that Big Sur has broken or causes issues in multiple apps I use with regard to the UI. I have one app where a slider control doesn’t work properly. I have no idea what that app is written in. And just yesterday I found an issue with Microsoft Teams when filtering a spreadsheet inside teams, the checkboxes don’t work properly. So there are UI issues with Big Sur.
Well, the plot thickens. I just tried Xojo’s Listbox to Listbox drag and drop example and it works fine. But looking at all of my code, it’s pretty much the same as Xojo’s but maybe something has changed with API2 that is breaking code that once worked. I’m going to try running my existing build on a Windows machine and see what happens there…
I found out where it is broken. It’s in Drag.AddItem. This code does not work:
Dim nRows, i As Integer
For i=0 To nRows
If Me.RowIsFolder(i) Then
If Me.Selected(i) Then
Drag.Text=Me.List(i) //get text
Return True //allow the drag
This code does work:
drag.Text = Me.List(row)
However, if you want to drag multiple items twos way, you can’t.
Had a look at your test project and the drag fails. But why does my code work:
Dim theDragItem As DragItem
theDragItem = New DragItem(Self.TrueWindow, OffsetX, OffsetY, finalDragPicture.Width, finalDragPicture.Height)
theDragItem.FolderItem = theAttachments(0)
for currentRecid as Integer = 1 to theAttachments.LastIndex
theDragItem.AddItem(x, y, finalDragPicture.Width, finalDragPicture.Height)
theDragItem.FolderItem = theAttachments(currentRecid)
theDragItem.DragPicture = finalDragPicture
? The drag comes as DragItemTV from a NSTableView and is re-created. Does this make a difference?
What if you try that way too? Put your code in the MouseDown event and create your own DragItem.
If it works, you can report the DragRow event is broken (a framework issue). If it doesn’t, it’s still a bug within your code.
I’m not saying it’s a bug “only” in your code. My guess is you are using something that pre-BS and Windows are tolerating (but are probably “undefined”) while BS finally became more strict and won’t allow something bad (like when Xojo introduced the ThreadUIException; it was, before, tolerated but as a risk and has became enforced later).
And you think it’s something BS has broken while it’s just that other systems are still tolerating something that shouldn’t be.