- char *accepted_drop_types[] = { "text/plain" };
- gtk_widget_dnd_drop_set( widget, TRUE, accepted_drop_types, 1, FALSE );
-};
+ return 1;
+}
+
+wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
+{
+ return wxDF_TEXT;
+}
+
+// ----------------------------------------------------------------------------
+// wxFileDropTarget
+// ----------------------------------------------------------------------------
+
+bool wxFileDropTarget::OnDropFiles( long x, long y, size_t nFiles, const char * const WXUNUSED(aszFiles)[] )
+{
+ printf( "Got %d dropped files.\n", (int)nFiles );
+ printf( "At x: %d, y: %d.\n", (int)x, (int)y );
+ return TRUE;
+}
+
+bool wxFileDropTarget::OnDrop(long x, long y, const void *WXUNUSED(pData) )
+{
+ char *str = "/this/is/a/path.txt";
+
+ return OnDropFiles(x, y, 1, &str );
+}
+
+size_t wxFileDropTarget::GetFormatCount() const
+{
+ return 1;
+}
+
+wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
+{
+ return wxDF_FILENAME;
+}