Skip to content

Interaction with dragged object #1254

Answered by BctfN0HUK7Yg
BctfN0HUK7Yg asked this question in Q&A
Discussion options

You must be logged in to vote

I found solution.
In my source widget:

if ui.memory().is_being_dragged(widget_id){
        let dragged_id=Id::new("dragged_id");
        ui.memory().data.insert_temp(draged_id, MY_ID);
...
}

In my target widget:

if is_anything_being_dragged {
 let dragged_id=Id::new("dragged_id");
 let MYID=ui.memory().data.get_temp::<MYIDTYPE>(dragged_id).unwrap();
...
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BctfN0HUK7Yg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant