Skip to content

Instantly share code, notes, and snippets.

@paniq
Created June 10, 2016 07:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paniq/d120eba2cf757c71d3e9ba191fad2c60 to your computer and use it in GitHub Desktop.
Save paniq/d120eba2cf757c71d3e9ba191fad2c60 to your computer and use it in GitHub Desktop.
static draggable-button (name id) :
void <- (rawstring uint)
if (BeginDragSource name id)
do
; visually remove entry
tuple ;
do
Button name
EndDragSource ;
static droppable-button (name id) :
void <- (rawstring uint)
if (BeginDropTarget name id)
do
Button "DROPPING"
Button name
do
Button name
EndDropTarget ;
static dragdroppable-button (name id) :
void <- (rawstring uint)
if (BeginDragSource name id)
do
; visually remove entry
tuple ;
do
if (BeginDropTarget name id)
do
Button name
vec2 100 100
do
Button name
vec2 100 0
EndDropTarget ;
EndDragSource ;
static dragdrop-demo () :
void <- ()
PushID "a"
dragdroppable-button "Drag-Drop Me 1" 1
PopID ;
PushID "b"
dragdroppable-button "Drag-Drop Me 2" 1
PopID ;
PushID "c"
dragdroppable-button "Drag-Drop Me 3" 1
PopID ;
PushID "d"
dragdroppable-button "Drag-Drop Me 4" 1
PopID ;
do-if (BeginDropHandle)
Text "Item ID: %i"
GetDropType ;
EndDropHandle ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment