DND: what kind of widgets are allowed?



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.


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?
--andy

#include <gtk/gtk.h>
#include <gtk/gtkselection.h>

int main(int argc, char **argv)
{
	GtkWidget *toplev, *label;
	GtkTargetEntry dragtypes[] = {
		{ "STRING",     0, 0 },
		{ "text/plain", 0, 0 }
	};

	gtk_init(&argc, &argv);
	toplev = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	label = gtk_label_new("adsfadfadfaf");

	gtk_drag_source_set(label, GDK_BUTTON1_MASK, dragtypes, 2,
			    GDK_ACTION_COPY | GDK_ACTION_MOVE);

	gtk_container_add(GTK_CONTAINER(toplev), label);
	gtk_widget_show_all(toplev);
	gtk_main();
}


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