Re: [fltk.general] [FLTK 1.3.5] Making a draggable item - [General Use]

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
Previous Message ]New Message | Reply ]Next Message ]

Re: [FLTK 1.3.5] Making a draggable item - [General Use] Catalin Poida 02:28 Sep 12 top right image
I saw in fltk 1.3.5  :
#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
  static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // platform dependent

Yeah, it's nice to be able to copy the image to clipboard, but yeah, creating a visual effect/feedback for the user it's also important.

Regarding how it should work. In theory, I understand what needs to be done, but the practical stuff kills me (the part where I need to shape the window exactly as the PNG image).

On Thursday, September 10, 2020 at 4:26:47 PM UTC+3 Ian MacArthur wrote:
On Thu, 10 Sep 2020, 12:53 Catalin Poida wrote:
I've saw the example with the drag and drop, but there was bo visual display of the item drag and dropped. There was only the technical part that send text data from one window to another.

I want to creat a visual experience as well, similar to how you drag and drop files in file explorer.

Recent versions of fltk can drag/drop a variety of formats (e.g. PNG) not just text. But you may need to compile with the later ABI to get that (which is not the default for 1.3)

I don't remember what ABI that was added at though - might only be 1.4.?

That said, you still don't get much visual feedback, so to get that you possibly need to do that yourself.

In essence you need a small bordeless window to show the payload in, and make that track the mouse motion during the drag operation.

When the drag stops (i.e. the button is released) you hide that window and enact the drop target action in the usual way.

It's a bit of a hassle, but...

TBH, I don't much care for that effect anyway (I guess I'm too old!) but it does seem popular in a lot of apps now.
From my Fairphone FP3

You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2020 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.