FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How To use dfl.clipboard?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Gekko



Joined: 12 Dec 2006
Posts: 4

PostPosted: Wed Jan 03, 2007 8:27 am    Post subject: How To use dfl.clipboard? Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Wed Jan 03, 2007 10:24 pm    Post subject: Re: How To use dfl.clipboard? Reply with quote

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
View user's profile Send private message
Gekko



Joined: 12 Dec 2006
Posts: 4

PostPosted: Thu Jan 04, 2007 3:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group