View previous topic :: View next topic |
Author |
Message |
Gekko
Joined: 12 Dec 2006 Posts: 4
|
Posted: Wed Jan 03, 2007 8:27 am Post subject: How To use dfl.clipboard? |
|
|
Hi, I would like to ask, if anyone tried or know how to use dfl.clipboard?
Where can I get an example how this works? I looked at the bundled example and documentation, but i couldn't find anything useful. |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Wed Jan 03, 2007 10:24 pm Post subject: Re: How To use dfl.clipboard? |
|
|
There is a little bit of usage in the dfltest.d but the idea is to set a Data (single value) or an IDataObject (multiple formats of a value).
For example, to set a regular ANSI string the type you'll use is ubyte[] since char[] implies unicode, and here's the code:
Clipboard.setDataObject(Data(cast(ubyte[])"hello clipboard"));
I'm thinking this might be cleaned up a bit for the next DFL release, but anything you use now should be compatible. Perhaps std.boxer can be used instead of Data, but I'm not sure as there used to be linker problems when using it and not sure if they still exist. Also might be able to take advantage of some of the newer D features; this module was written quite a while ago. Or I might simply add some overloads for the common data formats. |
|
Back to top |
|
|
Gekko
Joined: 12 Dec 2006 Posts: 4
|
Posted: Thu Jan 04, 2007 3:04 am Post subject: |
|
|
Code: | Clipboard.setDataObject(Data(cast(ubyte[])"hello clipboard")); | That works, thank you for this! I like DFL very much (because of Entice, and the simple but powerfull possibilities), but it could get some more documentation. Some examples here [1] would spice up the documentation to the top!
Nice work, I use DFL with fun and enthusiasm!
[1] http://wiki.dprogramming.com/DflDoc/HomePage |
|
Back to top |
|
|
|