- gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE );
-};
+ if (!widget) return;
+
+ gtk_widget_dnd_drop_set( widget, FALSE, (gchar **) NULL, 0, FALSE );
+}
+
+void wxDropTarget::RegisterWidget( GtkWidget *widget )
+{
+ wxString formats;
+ int valid = 0;
+
+ for ( size_t i = 0; i < GetFormatCount(); i++ )
+ {
+ wxDataFormat df = GetFormat( i );
+ switch (df)
+ {
+ case wxDF_TEXT:
+ if (i > 0) formats += ";";
+ formats += "text/plain";
+ valid++;
+ break;
+ case wxDF_FILENAME:
+ if (i > 0) formats += ";";
+ formats += "url:any";
+ valid++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ char *str = WXSTRINGCAST formats;
+
+ gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE );
+}