Re: DND: what kind of widgets are allowed?




Andy Kahn <kahn@zk3.dec.com> writes:

> --RnlQjJ0d97Da+TV1
> Content-Type: text/plain; charset=us-ascii
> 
> hi,
> 
> i've tried a simple test program (included below) where i tried to
> make a label widget as a DND source.  however, upon running the
> program, i get this message:
> 
> Gtk-CRITICAL **: file gtkwidget.c: line 3753: assertion `!GTK_WIDGET_NO_WINDOW (widget)' failed.
 
This cryptic triple negative, when deciphered, means that
the drag sources must be widgets with windows.

This is necessary, because GTK+ needs to be able to trap
the button press and mouse motion events that trigger
the drag sources.
 
> so my question is: what kind of widgets are allowed to be a source
> point for DND?
> 
> in general, are there any specific rules, limitations, et al, for DND?

DND source widget must be widgets with windows. The tutorial
used to have some explanation of the !NO_WINDOW/NO_WINDOW
distinction and a list of NO_WINDOW widgets. In general,
you'll need to put something like a label or pixmap
inside a GtkEventBox.

Drag targets, BTW, don't need to be widgets with windows.

Regards,
                                        Owen



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