On Wed, Apr 11, 2012 at 5:38 PM, strawman <straw...@lavabit.com> wrote:
>
> Thanks for the update; the example above works as shown, however it
> doesn't seem to play nicely with the clipboard:
>
> fmt = wx.wxDataFormat("HTML Format")
> obj = wx.wxLuaDataObjectSimple(fmt)
> obj.data = "test"
> function obj:GetDataHere() return true, self.data end
> function obj:GetDataSize() return self.data:len() end
> function obj:SetData(d) self.data = d return true end
>
> clip = wx.wxClipboard.Get()
> print(clip:IsSupported(fmt), clip:GetData(obj))
> --> true    false
> print(obj.data)
> --> "test"
>
> I've doublechecked the contents of the clipboard and there is definitely
> data available.  I've also tried passing 1 and 13 (CF_TEXT and
> CF_UNICODETEXT) to wxDataFormat, with the same result.

I think for custom formats you have to set the data to the clipboard
yourself. Is that what you're doing or are you trying to get HTML data
from copying from some other program? Try pasting a different
wx.wxLuaDataObjectSimple to the clipboard, but with the same
wxDataFormat and see if you can retrieve that.

If all you want is HTML from the some other program in the clipboard,
use wxDF_HTML and don't bother with the wxLuaDataObjectSimple, see :
http://wxlua.sourceforge.net/docs/wxluaref.html#wxDataFormatId

Regards,
    John

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to