Skip to content

How to use set_drag_drop_payload from Python? #85

Answered by pthom
johnor asked this question in Q&A
Discussion options

You must be logged in to vote

First of all, thanks for a great library!

Thank you!

TypeError: set_drag_drop_payload(): incompatible function arguments. The following argument types are supported:

  1. (type: str, data: capsule, sz: int, cond: int = 0) -> bool
    How can I create a capsule-object from a string or an integer?

I need to review the binding for this function, and this will require an adaptation to the code generator.

Its C++ signature is:

bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_size, ImGuiCond cond)

Basically, I will need to wrap void * data into a py::object so that it accepts any python object. I'm looking at this now.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@johnor
Comment options

@pthom
Comment options

@pthom
Comment options

@pthom
Comment options

Answer selected by johnor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants