This question already has an answer here:
PyGObject and glade send window to the front
(1 answer)
Closed 8 years ago.
I am currently building an application with python 2.7 with Gtk3+.
I want to open a window on top of another window. If the second window is visible, the parent one should not be clickable.
So the behaviour should be the same like opening a dialog window.
What is the best way to achieve this?
You need to use the property window.set_transient_for(parent_window)
This post may help you if you are using glade.
Related
This question already has answers here:
Can I detect if a window is partly hidden?
(2 answers)
How to determine if any part of the window is visible to Screen?
(1 answer)
How to get only the visible part of a window (Windows, gdi32, user32, etc)
(2 answers)
Closed 8 months ago.
I want to get a window's clip box so I can detect if the whole window is displayed.
package: win32gui
I know that IsWindowVisible() from the Windows API will return true if a window is NOT minimized, but it won't detect if the window is hidden behind other windows.
I also know that in C++, I could use GetWindowDC(); GetClipBox(); ReleaseDC(); to get a RECT struct with the coordinates of the smallest bounding rectangle of the window (I got this from another post on StackOverflow, but I haven't tested it).
In Python, I can use:
# That just returns a window by the title
handle = getWindowByTitle("Skype") # "Skype" is just an example
winDC = win32gui.GetWindowDC(handle)
# this function doesn't seem to exist/be implemented in win32gui
win32gui.GetClipBox(winDC, '''This also needs a RECT struct''')
win32gui.ReleaseDC(winDC)
How can I use GetClipBox() in Python? Or, is there any other way to check it?
I would like to not use any other package, because I want my app to have as few dependencies as possible.
I have also heard of ctypes, but I have never used them. I am not sure how it works, and/or if it can help here.
This question already has answers here:
PyQT QPushButton.setMenu? How to make it work?
(1 answer)
Qt: Drop-down button?
(8 answers)
Closed 9 months ago.
In my application, I don't want to clutter the screen with too many buttons, so I want to add multiple actions to one button. Even thought I could accomplish it through things like double clicking or modifier keys, those solutions are in no way intuitive for the user. I want to have a button that has an additional dropdown menu, which can be used to change the action of the button. To illustrate, here is a rough sketch of what that would look like:
Is this possible PyQt5 or PySide6? Thank you for your help.
This question already has answers here:
Load whole *ui file in an frame/widget of another *.ui file
(1 answer)
PyQt: How to switch widgets in QStackedWidget
(5 answers)
Creating a custom widget in PyQT5
(2 answers)
Closed 3 years ago.
I am making a simple app and was wondering what the standard is for multiple windows when using Qt Designer and python.
I need to be able to have functional back and next buttons which will take me to the previous screen like in simple .exe installers.
I do not want to use the tab widget.
I have tried using the stacked widget but when using layouts on my first screen it gets inserted into the grid layout.
This question already has answers here:
How do I handle the window close event in Tkinter?
(11 answers)
Closed 4 years ago.
I am building a GUI with Tkinter at the moment. With the GUI I can create files, add certain lines to the files, delete lines, save and load files. My problem is, that i want to prevent the closing of the window if the current file wasn't saved.
Is there a way to solve this problem?
Yes. That is totally possible (unless perhaps the process is being terminated abruptly), by making use of WM_DELETE_WINDOW protocol:
...The most commonly used protocol is called WM_DELETE_WINDOW, and is used to define what happens when the user explicitly closes a window
using the window manager.
This question already has answers here:
Is there a GUI design app for the Tkinter / grid geometry? [closed]
(3 answers)
Closed 6 years ago.
I have tried using Tkinter but it is not so easy to create Attractive GUI application.Is there an application or online website where I can use Drag and Drop approach to create GUI Interface in python.or some other easy way Also reply with some Intutive references or tutorial if possible.
Pyqt seems like a good option here. It's a cross platform GUI framework that comes with qt designer, an applicatiom that let's you build GUIs by dragging and dropping widgets on a canvas.
Here's a basic tutorial you can follow. There's also a series of videos included with imformation on how to download and install pyqt