Web Analytics Made Easy - Statcounter
Skip to content

Functions for Drag and Drop support

These are the calls you can make into the psgdnd package.

is_drop_event

Returns True if the passed in event is a drop event. A drop event is always a DropEvent object

is_drop_event(
    event
)

Parameter Descriptions

Name Type Default Description
event Any Event to check
RETURN bool Trye if the event is a drop event

register_element_dnd

Register a window element to accept Drag and Drop. Pass in your elmenent object, the window that contains it, the type of drops it can receive. Valid drop types: DROP_TYPE_TEXT, DROP_TYPE_FILES, DROP_TYPE_ALL

register_element_dnd(
    element,
    window,
    drop_type = "ALL"
)

Parameter Descriptions

Name Type Default Description
drop_type str ALL Type of drops it should accept. DROP_TYPE_TEXT, DROP_TYPE_FILES, DROP_TYPE_ALL
element (sg.Element) Element to register
window (sg.Window) Window that contains the element