I know that this might sound weird, but I have a problem considering the screen resolution of my Tkinter program. I have attached two pictures for a comparison.
I think you can clearly tell, what I'm talking about. The problem is that I don't really know why this happened. Suddenly the tkinter window had a way better resolution as you can see in the top picture. I did not change anything related to screensize/resolution by myself and was therefore expecting Tkinter to have published an update which just has better textures for every widget.
But because I had to reinstall python and all its modules this is no longer the case and the widgets look very blurry again (Bottom picture). Now I'm asking myself whether this has something to do with another version of Python or tkinter I'm using or what else could have been the reason for that.
I did not change my PC, Screen or anything like that. I just reinstalled python and its modules. Sadly I don't have the source code of the version where it looked great, but only an .exe file, because im continuously updating my program. But as I said before, I don't know what I could have changed which led to this huge resolution improvement.
I hope you get, what I'm trying to tell you.
Thanks in advance!
I was able so solve it!
I had a look on this question: on Stackoverflow
The answer from #binaryfunt solved my problem completely. So it was not really a tkinter/python thing, but rather windows itself.
Related
Sorry right off the bat, my English is bad. I use google translate.
Faced such a problem:
On my laptop, the interface scale is 125%. The maximum resolution of the monitor is 1920x1080, and I work with it.
While creating the Pyglet application window, with a resolution of 1280x720, I noticed that the window is clearly larger than what I expected. Having changed the resolution to the maximum one available to me - 1920x1080, using the second monitor, I realized that it is clearly larger than the main monitor.
For a long time and painfully, I figured out the cause of the problem, but found it out. When I set the interface scaling to 100%, instead of 125% that was comfortable for me, everything fell into place. The windows began to work as intended.
But this is not the way to solve the problem. Therefore, I have come to you with a question. How do I ignore the zoomed-in laptop interface in my application? Also, an alternative solution could be to change the scale of the interface while the application is running, and with this I would also like to contact you. Can someone suggest how to implement one of the solutions?
I should have guessed that the same problem could be with Pygame.
Solution:
import ctypes
ctypes.windll.user32.SetProcessDPIAware()
https://gamedev.stackexchange.com/questions/105750/pygame-fullsreen-display-issue
I wrote an Tool with a wxPython GUI. On Full HD and less everything runs fine. A friend of mine tested a bit with my tool and he uses a Microsoft Surface Book laptop with a screen resolution of 3000x2000 and DPI set to 200% on Windows 10.
And he has the problem that everything in my GUI is very small.
I tried to prevent that with this piece of code:
import ctypes
try:
ctypes.windll.shcore.SetProcessDpiAwareness(True)
except:
pass
But that didnt help at all. Does anybody have experience with a problem like that? What else could i try?
I think there is already a question similar to this in Stackoverflow. Anyway.
So far I think the only thing you can do is to set the app to use System (Enhanced) in the High DPI scaling override box.
It does not matter if you do not have a .exe file. You can change the properties of the resulting python app window when you run it as python myApp.py.
If the picture is not enough, there are more details in the first question here.
I have a laser pointer that I'm using along with my webcam as a drawing tablet, but I'd like to use the extra buttons on it too. They seem to be bound to Page Up, Page Down, Escape, and Period. I can't seem to figure out a way to get the input(which is handled like it's a keyboard) without any windows being selected.
I've tried serial and pyusb, but I've had issues with both of those. I got it to work with Pygame, but as far as I know, you can't receive input without the window it creates being selected. Any ideas?
You could try making a python key-logger. However, it would be much easier to just use Pygame.
CodeSurgeon answered me in a comment.
Looks like there are a lot of youtube tutorials on the subject, surprisingly. This one shows a cross-platform approach using the pynput module, while this one looks to be using a windows-specific approach (pyhook and pythoncom). Can't vouch for either of these as I just found them through some searching, and I am sure there are others as well.
I found that pynput works for me. (Windows 10/Python 3.4)
I have been all over the web looking for a solution to this problem!
I'm looking for a way to make my VLC window "click through" on linux.
I have found some python code here: https://stackoverflow.com/a/11917174/3426514 that says it can solve the problem, but I dont know how to apply that answer to my VLC window.
Is there a way to make a bash script that i can execute after vlc has started that will make the vlc window click-through? Or anything else, like a CCM plugin or a vlc plugin or magic foo?
I'm on ubuntu 14.04 if that is helpful :)
Edit: Another implemetation, part of the notifications code:
https://github.com/dkasak/notify-osd-customizable/blob/master/src/bubble.c#L1608
Edit2: A SVG Implementation, dont think this applies, but it is kinda relevant https://superuser.com/questions/699289/making-cairo-clock-click-through-able-cairo-graphics
Edit3: The used to be a compiz plugin called ghost a long long time ago https://github.com/compiz-reloaded/compiz-plugins-experimental
Edit4: To address the downvote to close: I expect the actual code to do this would be a few lines at most, i just have no clue how to do it. If there is something that I can provide to narrow the focus or provide more information, I will gladly do so.
Edit 5: Another related question. Create a click through window for Linux
You can have VLC write to the desktop background, then set all your app windows to be partially transparent. Output to Background is a VLC option. What you want is backwards from that, where VLC is overlayed on top of everything else, but ignored for user input, however if you don't mind going the other way, it's "already in there" 8-)
I need to make a sub window using The pygame package, I want to do two type of subwindow, the first fixed in of the window and the second type completely independent of the window.
While approaching this problem, be aware that two windows is pretty much impossible for Pygame, since it is dependent on SDL and SDL is limited to 1 screen.
Maayyybbe, you could run two different programs that have different windows and can interact with each other via some networking you set up. But at this point, you'd probably be better off coding in something else.
Making a sort of subwindow is doable by splitting up your screen, and to use parts of it for one thing, and others for something else. For example, you can blit images to this separate "window" that have totally different things going on than the stuff outside of it.
Also, please google before posting a question, a quick google search revealed Pygame with Multiple Windows, which answers half of your question.