Python tkinter - windows larger display settings - python

My problem is when somebody runs my tkinter gui (in Windows 7) and has larger display settings (125%), the gui doesn't look well (buttons are closer to each other, end of text cannot be seen, etc.). I use place method with x - y coordinates to place the widgets.
Maybe using pack method could solve this, but it is easier to use place for me, because there are lots of labels and buttons with exact places.
Another solution can be if the display settings could be checked with pywin32 and resize everything if needed. If it is possible, please confirm and help, what is the related function or if you have any other idea/advice, please share it.

This is one of the reasons why place is a poor choice. You should switch to using grid and/or pack. They are specifically designed to handle different screen sizes, different resolutions, different widget styles, and different fonts.

Related

Python tkinter app, ttk-heavy, pretty on MacOS, ugly on W10

I'm making a Python3 app with tkinter for GUI. I intend to make binaries for MacOS and Windows, and that was one of the reasons why I choose tkinter. I am using ttk for the widgets, and I was under the impression that that would automagically look great on all OSes.
But the colours are different. The distances to other widgets and borders are different. The button with a lot of text isn't wide enough. Frankly it just looks like crap on W10.
Is there some trick to getting it to look good on both of these two OSes, such as though certain styles?
The ttk widgets on each platform have their own default colors, margins, borders, fonts, etc. It is by design that they look different on different platforms.
Unfortunately, that means that you may have to add some platform-specific code from time to time to account for this. For example, you can add a little padding to the button, and you can manually set the color of the labels, or use geometry manager options to get them to fill the whole width of the screen with the same color.
Your goal is obtainable, but it will require a little more work to get it to look its best on all platforms.

PyCharm Code Folding Collapse

In PyCharm, I have it selected in my settings so that when I collapse the code within a method or I collapse my import statements, I get the box on the left hand size by the line numbers with the "+" inside it to expand when I want to investigate.
Is there any way to adjust the color settings in PyCharm regarding that expansion box with the "+" so that is stands out better? On my Mac it stands out just fine and I can always find them, but on my Windows machine (using a very similar if not the same Darcula color settings .jar) the boxes blend in too perfectly with the background of the script and I have trouble finding them. I am not sure if it is that the box is not outlined properly, or if the colors prevent me from seeing the outline at all.
Thanks!
I personally prefer to use the keyboard shortcuts for (un-)folding. They are very helpful and maybe you can have a look. I also sometimes click "in the code" to fold or unfold code.
If that does not solve your problem, intelliJ comes with 3 different default UI themes (Darcula, GTK+, IntelliJ on linux) that you can change in Settings > Appearance > Theme. Maybe you can switch to another theme.
If they're not what you need, you can also download custom theme plugins such as: https://plugins.jetbrains.com/plugin/8006?pr= . Perhaps "material black" which is close to "darkula" can render your buttons a bit more clearly.
Or, you can also define custom themes to change only the plus button (as it's an "appearance" setting, not syntax highlighting, you can't easily change the color or the shape of that specific button). It's more hard than the two previous solutions (as it involves creating a custom plugin), but you can pick one from github and just change the icon you need. https://github.com/ChrisRM/material-theme-jetbrains/tree/master/resources/icons could be a good starting point

How Can i open a subwindow with pygame?

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.

How to get multiple panels in one window - GTK+

I am looking to know what is the best practice to make a window which the content changes, but without changing the window. Something like using tabs, but with no tabs, controlled with buttons.
What widget should i use to archive what i need?
And if you don't mind the little off-topic, should it be drawn manually or with a GUI designer like glade?
It is meant to be used within python.
If you can use GTK 3.10, take a look at GtkStack and GtkStackSwitcher. If not, use GtkNotebook and set the show_tabs property to False, then build your own buttons.

tkinter: Is it possible to attach GUIs from different tkinter programs together and easily navigate across them?

I'd like to build a number of tkinter GUI apps and then stack them together either horizontally or vertically. I'd also like to navigate across the app easily once they become attached so that at any time I can focus on them.
One idea in my mind is that I can have a webpage like frame container, with a scrollbar, then drag other app's GUIs into it so that I can scroll across them.
To attach the windows, I understand that maybe I can get individual app's window through process info, but I just want to make sure if there is a built-in or better way of doing the things I want.
Seeing as you didn't capitalize tkinter, I'm going to assume that you are working in Python 3. If this is so, there are two options that I can think of: Using tkinter frames/grid geometry manager to place each widget side by side, and using tkinter.ttk Notebook to have multiple application tabs. you could also mess around with creating a scrollable tkinter Frame if you were dead set on the scrolling part, but from other Stackoverflow pages it appears that there is no native way to do that.
Example of tkinter.ttk Notebook

Categories

Resources