+
+ if( chosenFormat == wxDF_INVALID )
+ return false;
+
+ ///////////////////////////////////////////////////////////////////////////
+ // now retrieve the data
+ ///////////////////////////////////////////////////////////////////////////
+ unsigned long length, dummy1;
+ long dummy2;
+ wxString id = chosenFormat.GetId();
+
+ while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
+ wxConstCast(id.c_str(), char),
+ &length ) )
+ == XmClipboardLocked );
+ if( retval != XmClipboardSuccess )
+ return false;
+
+ wxCharBuffer buf(length);
+
+ while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
+ wxConstCast(id.c_str(), char),
+ (XtPointer)buf.data(),
+ length, &dummy1, &dummy2 ) )
+ == XmClipboardLocked );
+ if( retval != XmClipboardSuccess )
+ return false;
+
+ if( !data.SetData( chosenFormat, length, buf.data() ) )
+ return false;
+
+ return true;