Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcceptDragDropPayload can't be checked for nil #231

Closed
ptxmac opened this issue Nov 21, 2023 · 5 comments
Closed

AcceptDragDropPayload can't be checked for nil #231

ptxmac opened this issue Nov 21, 2023 · 5 comments

Comments

@ptxmac
Copy link
Contributor

ptxmac commented Nov 21, 2023

AcceptDragDropPayload will return a "nil" Payload if the currently dragged item is not of the expected type. There's currently no way to check this.

Either AcceptDragDropPayload should return a nil object if the payload is nil, or the Payload type should have a way to check for nil

I.e. from the client code:

if AcceptDragDropPayload("Node") != nil {
  // handle drop
}

OR

if !AcceptDragDropPayload("Node").IsNil() {
  // handle drop
}
@gucio321
Copy link
Collaborator

I can fix it in #229 but I have a problem there so idk when will it get to master...

gucio321 added a commit to gucio321/cimgui-go that referenced this issue Nov 30, 2023
gucio321 added a commit to gucio321/cimgui-go that referenced this issue Nov 30, 2023
@ptxmac
Copy link
Contributor Author

ptxmac commented Feb 17, 2024

Confirmed as working! 🎉

@gucio321
Copy link
Collaborator

hreat to hear!
But I accidently removed Payload.Data() 😄 - will fix soon

@ptxmac
Copy link
Contributor Author

ptxmac commented Feb 17, 2024

Yeah, that didn't work before for me anyway, so my local hack was just to keep drag data in a global variable 😄

@gucio321
Copy link
Collaborator

now should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants