LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Copy to Clipboard (http://www.linuxquestions.org/questions/programming-9/copy-to-clipboard-620073/)

rubadub 02-10-2008 06:09 AM

Copy to Clipboard
 
Using either C or C++, how do you copy to clipboard and probably paste whilst were at it please?

nc3b 02-10-2008 08:09 AM

http://www.loria.fr/~szathmar/off/pr...oard/index.php

This seems to work if you're looking for a windows solution.

rubadub 02-10-2008 09:21 AM

yes, i've found that for windows the functions are in user32.dll (GetClipboardData, SetClipboardData, etc), but I am after linux capability (must be somewhere cos most standard apps use it!). I was origionally looking to use it with the irrlicht library, yet they actually seem to have it already, but on closer inspection it may just be for win (also have libs for mac). Also i've found some ref's in doc's for MiniGUI which is nix...

TBC...

rubadub 02-10-2008 09:24 AM

Wine has users.c and cygwin seems to have library somewhere...

fantas 02-10-2008 09:49 AM

Hi there rubadub ...

under Linux you'll find (unfortunately) two (or more ?) different solutions. Unfortunately in the sense that there will be differences between applications, unless it implements several options.
For now I'll just list the two I know and leave it up to you - or maybe someone else will chip in - to google/decide what's best for you. Both are feasible with core X11 functions.

1) cut buffers (easiest but kinda old)
2) selections (more reliable)

rubadub 02-11-2008 02:39 AM

Cheers for that fantas, upon researching (a little) it 'is' said that 'cut buffers' shouldn't be used any more in favour of the 'selections' method described by the ICCCM documents. However at this time I haven't the time (8.39am), so once again TBC...

Cheers


All times are GMT -5. The time now is 11:38 PM.