class UIng::Drop::Handler

Overview

Shared drop callbacks receive their Window/Area target first. Configure and register on the UI thread; callback changes apply to all targets. Return true from over/drop to accept Copy/the drop.

Defined in:

uing/drop/handler.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(accepts : Format = Format::All, &) #

[View source]
def self.new(accepts : Format = Format::All) #

[View source]

Instance Method Detail

def accepts : Format #

[View source]
def clear_drop : Nil #

[View source]
def clear_leave : Nil #

[View source]
def clear_over : Nil #

[View source]
def drop(&block : Proc(Target, Event, Bool)) : Nil #

[View source]
def drop(callback : Nil) : Nil #

[View source]
def leave(&block : Proc(Target, Nil)) : Nil #

Ends hover feedback. It may precede a successful drop and is not a cancellation or destruction notification.


[View source]
def leave(callback : Nil) : Nil #

[View source]
def over(&block : Proc(Target, Info, Bool)) : Nil #

Metadata only: filenames and text are available in drop, not over. Without this callback, compatible Copy offers are accepted while a drop callback is installed. Clearing drop also rejects hover offers.


[View source]
def over(callback : Nil) : Nil #

[View source]
def to_unsafe : Pointer(LibUI::DropHandler) #

The target retains the callback context; active calls retain their Proc. Native retirement stops new calls. ReleaseUserData remains unused.


[View source]