Re: Drag and Drop between CLists



Rick Niles was overheared mumbling something about this on Thu, 15 Jun 2000
16:13:16 -0400

>  I'd like to be able to drag and drop between CLists as well as
>  re-order items in a give Clist.  It seems I can't have both. I've
>  tried to use the usual DnD Gtk stuff, but it seem like it's already
>  used for within list DnD.  If I try to add another callback it just
>  breaks the within list DnD.	It would be nice if CList could both use
>  DnD internally and export it's data.

Its an all or nothing deal.  You can either use gtk_clist_set_reorderable() and
thats all you get, or you can impliment your own Drag-N-Drop functionality. The
roll your own approach is the better of the two, although you'll find that you
can cut-n-paste quite a bit of the reorderable code from Gtk, so you don't
really end up re-inventing the wheel here.

>  I'd also like to be able to drag the CList row to a xterm and have the
>  text from that CList appear in the XTerm.

Again, this is easily doable with the standard Gtk DnD functions.

>  This all seems possible with a little work on the existing CList by
>  someone with experience.  Perhaps all that is need is to document the
>  existing internal DnD data so external widgets can properly recv. the
>  data.  (I'm not sure about that though.)

No. The internal Drag N Drop stuff for reorderable mode is great, but there is
not really a good way to allow outside functions to access the
gtk_drag_source_set() functions etc... no way they can know what actions you
want to add, no way the callbacks can deal with the actions that you add,
etc... So, the only way is for you to roll-your-own... Remember, there is only
one "drag-data-get" and "drag-data-recieved" signal for a widget... You gotta
add your functions in the callback for that so you need your own functions. 
(ie: you can't have your cake and eat it too)

>	Can I get anyone to add better DnD to the CList?

Sure, do it !

>	Thanks,
>	Rick Niles.

You're welcome.

-CZ
-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/CM d--(+) s+: a- C++++ UL++++$ P+++ L+++>++++ E--- W+++(--) N+ o? K?
w---(++) O M->-- !V PS+++ PE Y+ PGP t+@ 5? X+ R++ tv-- b+++ DI? D++
G e h r- y+
------END GEEK CODE BLOCK------







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