Re: tooltips and DND



hi jeff,

> > if i DND a file over this kind of button the tooltip
> > is not shown - in general it works but not in this case.
> > 
> > is that my fault, bug or feature?
> 
> It's a feature of the current tooltips implementation. :-(
> 
> When a thing is being dragged, the "enter" and "leave" events
> that would have arrived at the drop zone and triggered the
> tooltip are instead being redirected to the widget that you
> dragged from (more or less). Thus the tooltip never knows
> you're "there".
> 
> In the drag and drop protocol as I remember it, different
> events *are* still being sent to the "entered" widget,
> specifically ones that say "a droppable thing is over you".
> That's so the widget can change shape or otherwise indicate
> that it is a drop zone.
> 
> If that's how it still works, tooltips MAY be able to trap
> these as well, and treat them as enter and leave events,
> thus making the stuff "work right".
> 
> In any case, the events are being redirected, not lost, so
> it is POSSIBLE to implement tooltips (and dnd) such that
> this would work, if the time is put in to do it.

i tried to add a signal handler to the button for drag_motion
which looks like
/*
 */
gboolean
button_drag_motion (GtkWidget *btn, GdkDragContext *context, gint x, gint y,
                    guint time, gpointer tip)
{
    gtk_signal_emit_by_name (GTK_OBJECT(btn), "enter_notify_event");
    return (TRUE);
}

the result is a segmention fault during DND :(
gdb traces to gtk_marshal_*:

#0  0x40118549 in gtk_marshal_BOOL__POINTER ()
#1  0x400d6f5c in gtk_signal_real_emit ()
#2  0x400d51e2 in gtk_signal_emit_by_name ()
#3  0x804a84b in button_drag_motion (btn=0x80882e8, context=0x80961c8, x=7, 
    y=22, time=2654131737, tip=0x8085950) at xap_gui.c:108

hm..!? is there an alternative to gtk_signal_emit_by_name() which
is should use in this case?

cu
 rasca 
-- 
 /#- Internet eMail: thron@gmx.de, FidoNet: 2:2410/304.5@fido -#\
<-#- Internet WWWeb: http://home.pages.de/~rasca/ -------------#->
 \#- please do NOT quote these lines or other useless stuff! --#/



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