Re: dnd from clist to text entry question



Excellent, that's what I was looking for, it works very nicely. Thanks for 
your quick and helpful response.

BTW, I saw you got a mention in this months Linux Journal for ManEdit, 
congrats!

Mike

On Sunday 06 May 2001 20:17, learfox furry ao net wrote:
I'm creating a dialog box which allows the user to drag text from a clist
into a GtkEntry widget. I've got the drag and drop stuff working, but
only if you actually select a row from the clist first, then drag it to
the entry widget and drop it. In my mind it seems rather unfriendly to
force them to click once to select the row, then preform the dnd.

It's that way on most applications.

The DND drag_begin detects button press and a motion beyond the origin of
the button press.  So I think in yer drag_begin you can try and use
gtk_clist_get_selection_info() to see which row it was over, then
manipulate the clist `focus row'.

So when yer data request calls on that clist, instead of sending data
for the selected row, send data for the focus row (see the GtkCList
structure for the focus row member).


One BIG WARNING though, this means that DND won't work for multiple
selections. For example if the user wanted to select a bunch of items,
then drag them to a destination widget.

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
...__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/




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