Re: dnd internals questions.




Todd Dukes <tjdukes@flash.net> writes:

> Owen Taylor wrote:
> > 
> > Todd Dukes <tdukes@ibmoto.com> writes:
> > 
> > > I want to change the drag icon used by clist for drags.
> > >
> > 
> > But if you want to change the drag icon for reordering
> > rows in the CList, I think the answer is that it isn't
> > possible. Basically, the reordering DND is not really
> > set up to be customized either in drag types, or icons
> > sorry.
> > 
> > People who want to support both reordering and DND from
> > a CList widget have so far typically used different
> > buttons for each operation. It is a bad UI hack, admittedly,
> > but about the best you can do right now.
> > 
> 
> I was not using the reordering that is internal to clist. I 
> was doing it all myself. I just set the clist to be both a
> target and a source. Whether there is a target or not you
> cannot set the drag icon. I haven't checked, but it looks like
> it is the same for ctree. Even if you change the drag icon,
> when gtk_clist_drag_begin gets called, it is changed back to
> the default icon. I see this as a big limitation. 
> 
> What exactly is drag_begin for? Only 3 or 4 widgets implement it
> and I didn't see a default method.
 
The "drag_begin" signal is there to allow an application,
when a drag starts to:

 a) record any information it needs about the drag
 b) change the cursor

The CList's implementation of drag_begin is there only to
handle doing these things for the reordering DND. That
it is triggered when reordering is not turned on, is
IMO, a bug.

As a workaround, you can use the normal method of overriding
a default handler:

 Connect to "drag_begin"
 In your handler, do a gtk_signal_emit_stop_by_name (GTK_OBJECT (clist), "drag_begin");

> > > Also, is it possible to control the drag icon used by which modifiers
> > > ( ctrl, alt, shift ) are held down when the drag begins?
> > 
> > I'm not quite sure what you are asking, but, probably not:
> > 
> >  - the cursor for each operation (move, copy, link, ask)
> >    is fixed. (However, you can influence the default operation
> >    by changing the mask of possible operations)
> > 
> >  - the assignment of modifier keys to operations is also fixed.
> > 
> > It would be a bad idea to change either item, because it
> > would confuse the users.
> > 
> 
> I believe you answered my question. 
> 
> See if I understood your answer. You are basically saying that 
> even though you can set an alternate drag icon, you cannot set
> an alternate group of icons that are selected based on the drag
> modifiers. I assume that the cursor is drawn on top of 
> the drag icon automatically by the x server, gtk just changes 
> the mouse cursor to use. I wanted to change the icon in addition
> to the cursor. Maybe I'll be able to get the users to look at the
> tiny cursor instead of a big drag icon :)

If anybody wants to contribute alternate drag cursors, go
right ahead. I'll make no claim to being a graphic artist.

But the feedback for drags needs to be standard.

Regards,
                                        Owen



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