module Iup::DragDropAttributes

defines attributes and methods for drag and drop

Steps to use the Drag & Drop support in an IUP application:

AT SOURCE
  • Enable the element as source using the attribute DRAGSOURCE=YES;

  • Define the data types supported by the element for the drag operation using the DRAGTYPES attribute;

  • Register the required callbacks DRAGBEGIN_CB, DRAGDATASIZE_CB and DRAGDATA_CB for drag handling. DRAGEND_CB is the only optional drag callback, all other callbacks and attributes must be set.

AT TARGET
  • Enable the element as target using the attribute DROPTARGET=YES;

  • Define the data types supported by the element for the drop using the DROPTYPES attribute;

  • Register the required callback DROPDATA_CB for handling the data received. This callback and all the drop target attributes must be set too. DROPMOTION_CB is the only optional drop callback.

Public Instance Methods

dragbegin_cb(callback) click to toggle source

callbacks for drag-n-drop

# File lib/wrapped/drag-drop-attributes.rb, line 29
def dragbegin_cb callback
  define_callback callback, 'DRAGBEGIN_CB', :ii_i
end
dragdata_cb(callback) click to toggle source

Note: user data assumed to be a string

# File lib/wrapped/drag-drop-attributes.rb, line 38
def dragdata_cb callback
  define_callback callback, 'DRAGDATA_CB', :ssi_i
end
dragdatasize_cb(callback) click to toggle source
# File lib/wrapped/drag-drop-attributes.rb, line 33
def dragdatasize_cb callback
  define_callback callback, 'DRAGDATASIZE_CB', :s_i
end
dragend_cb(callback) click to toggle source
# File lib/wrapped/drag-drop-attributes.rb, line 42
def dragend_cb callback
  define_callback callback, 'DRAGEND_CB', :i_i
end
dropdata_cb(callback) click to toggle source

Note: user data assumed to be a string

# File lib/wrapped/drag-drop-attributes.rb, line 47
def dropdata_cb callback
  define_callback callback, 'DROPDATA_CB', :ssiii_i
end
dropmotion_cb(callback) click to toggle source
# File lib/wrapped/drag-drop-attributes.rb, line 51
def dropmotion_cb callback
  define_callback callback, 'DROPMOTION_CB', :iis_i
end