[Lazarus] GTK2: Drag files to other applications (to the file manager, Thunar, Nautilus, etc)
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Wed Aug 22 15:49:39 CEST 2012
Bernd schrieb:
> 2012/8/22 Hans-Peter Diettrich <DrDiettrich1 at aol.com>:
>
>> What's complex in providing a list of filenames, in a TStrings object, and
>> let the RTL/FCL do the rest?
>
> How would you find he appropriate window handle of a TButton to
> initiate XDND on xorg without asking GTk2 or Qt? And what if the
> TButton does not have its own window at all? How are you going to do
> this without asking the widgetset for an appropriate handle to use and
> how are you going to intercept the mouse events in a widgetset
> independent way from inside the RTL during the drag?
You should familiarize with the basics first, before asking me to solve
your selfmade problems.
Dragging means to fill a data structure with all required information,
and pass it to the OS. Then the OS (window manager) will watch for mouse
moves, try to find drag targets under the mouse, ask them for feedback,
and finally notifies them about drops. The protocol for all these
operations is platform specific, and not based on window handles on
platforms which don't have such handles.
The RTL can ask the Application object to handle DND related events,
e.g. by generating the according messages, if not already done by the OS.
DoDi
More information about the Lazarus
mailing list