[Gambas-user] Persistent clipboard?

Bruce Steers bsteers4 at gmail.com
Sat Jan 30 17:54:32 CET 2021


Can anything be done about the way the clipboard clears on app exit?

I have just implemented into a few of my apps detecting clipit.
clipit seems to work well
upon a call to Clipboard.Copy() i use a simple...

*If $bHasClipit Then Shell "echo -n " & Quote(sText) & "|clipit"*

Then the text is still in the clipboard after program exit if the user has
clipit installed.
Would be amazing if Gambas could use clipboard differently to be persistent
after app exit.
Or maybe an alternative Clipboard.CopyPersistent() command that would
obviously be slower but an awesome feature.

I could imagine something simple like...

*Public Sub Form_Close()*


*  ' check if clipboard has text contents and make it still exist after
program exit.*

*  If Clipboard.Type = Clipboard.Text Then Clipboard.CopyPersistent()*


*End*

And voilla , no more "dang it i need to open the app again and go through
the procedure to get that text"  ;)

I tried to add it to a TextEditor's internal Copy() command but it seems
the copy command is called when text is only being selected via mouse drag
and not just when a call to Copy is made.  I could not see where that was
happening to try a workaround (any clues Ben?).

Just some food for thought.
Much love
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210130/21258b9c/attachment.htm>


More information about the User mailing list