- /* this will fail for composite formats */
- if (format.GetType() == wxDF_TEXT)
- {
- wxTextDataObject *text_object = (wxTextDataObject*) data;
- wxString text( text_object->GetText() );
-
-#if wxUSE_UNICODE
- const wxWX2MBbuf s = text.mbc_str();
- int len = strlen(s);
-#else // more efficient in non-Unicode
- const char *s = text.c_str();
- int len = (int) text.Length();
-#endif
- gtk_selection_data_set(
- selection_data,
- GDK_SELECTION_TYPE_STRING,
- 8*sizeof(gchar),
- (unsigned char*) (const char*) s,
- len );
-
- return;
- }
-