Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear() function to pygame.scrap (also, rename?) #4175

Open
Quotatron3000 opened this issue Mar 13, 2024 · 1 comment
Open

Add clear() function to pygame.scrap (also, rename?) #4175

Quotatron3000 opened this issue Mar 13, 2024 · 1 comment

Comments

@Quotatron3000
Copy link

Firstly, let me pre-face this by saying, whilst I know it is experimental, that adding pygame.scrap is amazing, and to please continue to develop it - at the very least, keep it as a permanent feature. It is difficult to find a good clipboard library anywhere, and X11 clipboard is a nightmare to grasp.

Too many third party clipboard programs are either far too simplistic (pyperclip only handles text), too buggy (tkinter seems incomplete), or extremely overcomplicated (Qt5 uses 'Qt-native' types that overcomplicate variable design and are incompatible with third party applications). I've searched high and low and pygame is the first one that seems to 'do it right' - just enough features without being overcomplicated. Keep up the great work.

Clear MIME data?

That said, pygame.scrap requires one key feature: the ability to clear the clipboard. Otherwise, older MIME-type metadata still hangs around on the clipboard.

For example, if I copy an image from GIMP, it will have several different versions of the image on the clipboard (image/bmp, image/png, image/tiff - you get the idea). If I copy out just the PNG data to use in pygame to, say, add text to it, and then push it back into the clipboard, I will only be replacing 'image/png' - but the MIMEtype metadata for all the other, older images will still exist - and GIMP will only pick up the old metadata rather than the PNG specifically.

So there needs to be some way to 'clear' both individual MIMEtypes and their data, and also 'all MIMEtypes'.

Rename?

Also, I didn't want to be "that guy", because I like your work, but 'scrap' means to 'get rid of something' (he scrapped his car). Is the module meant to be called 'scrape' (as in, he scraped something off his windshield)? I suppose you could say you're getting scraps of paper from the clipboard (rather than a scrape from the clipboard). I don't personally care on the spelling, just mentioning in-case it is important for consistency.

@aarjaneiro
Copy link

Regarding the module name, I believe scrap is meant to reflect the copy/pasting one might do to construct a scrapbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants