Re: passing non-string data in drag and drop



WAN Hing Wah <50191914@ee.cityu.edu.hk> writes:
> How can I pass non-string data,such as pointer in drag and drop?
> The GtkSelectionData can only pass string data...

GtkSelectionData can pass any array of bytes, it doesn't have to be a
string. The idea is that for a given target (such as text/plain), 
the contents of the byte array are defined. So you can make up your
own target and define the byte array to contain whatever you want,
such as image data.

> Moreover.the GdkDragContext can only get the source GdkWindow...so I can't 
> transfer data using gtk_object_set_data too...

There's another problem with using set_data(), which is drags between
processes, though you may not always want to support that. (But, it
may be useful to know that the "user_data" field of a GdkWindow is the
widget that the window belongs to, if any.)

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]