开发者

Ruby, windows clipboard bug?

Question: Is it normal for a Ruby TK GUI app to empty the windows clipboard on exit?

Problem: I have a TkText with some text in it, if I Ctrl + C then close the application the clipboard is empty, if I paste while the application is still open everything works fine, after pasting once it doesn't even matter to close the application, it still remains in开发者_开发技巧 the clipboard.

Is this intended to happen?


It sounds like Delayed Rendering may be in effect. You've probably seen this with apps like Excel, Word, Outlook, or just about any large drawing program. You copy, and when you close the app is says something like "you've placed a large amount of data on the clipboard, would you like to make it available to other programs?". That's because the copy was done with "delayed rendering" and the data isn't really on the clipboard. The clipboard just has empty handles, and if/when something actually requests to paste (especially exotic or expensive formats like WKS1, SYLK, EMF, HTML, etc..), the app is required to produce it on the spot. So upon shutdown, these apps are really just taking care of these unfulfilled liabilities because they won't be around to answer the WM_RenderFormat messages after they're gone. I expect that your ruby environment is using delayed rendering for even simple formats like CF_TEXT, and rather than updating the clipboard with fully-populated data (which lots of apps do, silently), they just blow it away. Or maybe they DO leave null handles out there. Running the old XP clipboard viewer would show you the difference between a truly empty clipboard, and one that thinks it has text (TEXT shows up in the list of available formats) but really just has null handles.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜