Re: Drag-n-drop between tabs



The mechanism i'd implement would be:

- Create something that can serve as a container for other widgets,
and add an interface to it for being a DND-proxy (that's easiest done
in gtkmm really, with C Gtk+, it's of course also doable)

- Use that in the notebook tabs

- Configure it to proxy DND for something that's inside the tabs
(could be basically anything but of it's probably going to be
something in the tab)

- In that thing, install an Gtk::Widget::drag_motion handler, to
determine if the give type can be accepted, and a handler for
Gtk::Widget::drag_leave

So basically the proxy system would determine whether something can be
accepted at all, and change the mouse cursor to a 'drop' cursor (i
don't know off head which X cursor this is), if, and only if the type
can be accepted, then a timer is started and some code flips the
notebook page after, let's say 1.5 seconds (sound reasonably short and
with good margin for error, so one doesn't go about devastating his UI
by dragging things around accidentally).

The drag-leave handler would be responsible for resetting the cursor
shape for the relevant GdkWindow, and to stop the timer, and abort
other pending stuff that would be started when a drop candidate has
entered the tab region.

On 9/13/07, saulgoode flashingtwelve brickfilms com
<saulgoode flashingtwelve brickfilms com> wrote:
> I am interested in enhancing the drag-n-drop functionality of the GIMP
> and am unable to find whether GTK+ supports the feature I desire.
>
> The GIMP uses a notebook widget for docking various windows and it is
> often convenient to have the Layers window and Channels present in the
> same notebook (as shown in the first figure in
> http://docs.gimp.org/en/gimp-concepts-docks.html). The problem I wish
> to solve is being able to drag a layer from the Layers tab over  to
> the Channels tab. This is currently only possible (to my knowledge) if
> I detach one of the tabs and thus far I have been unable to find how
> this would be implemented.
>
> If there is a way to do this, I would appreciate if someone could
> point me in the right direction. If not, would it be feasible to
> enhance the notebook widget so that hovering the pointer over a tab
> while a mouse button is depressed for a certain duration (one or two
> seconds) would raise that tab?
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>



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