How do I make a window draggable without a header? - python-3.x

So basically I have this main window with just a bunch of buttons on it. I am hiding the default header by using self.set_decorated(False). I want to be able to drag the window around my screen by clicking anywhere that's not a button. Is this possible? I haven't been able to find anything on this except for self.begin_move_drag(self.button_drag, event.x_root, event.y_root, event.time) which I don't really understand.

hb.props.custom_title = Gtk.Label(label=" ")

Related

PYQT Taking a screenshot of a hidden QWidget

I have a QTabWidget with different tabs.
I want to take a screenshot of a hidden tab.
I found out how to create a screenshot of the tab if it's selected now.
The problem is that I want to be able to do that even if another tab was selected.
The solution was very simple in the end, I hope it would help someone if he needs to.
To capture a screenshot of a widget you have in your application, even if it's not currently visible.
For example if you have a number of tabs in your QTabWidget:
# tabs_hash is a dictionary of the widgets we have in the QTabWidget,
# or any widget we have in the application we want to print
for name in tabs_hash:
file = f'{name}.jpeg'
tabs_hash[name].grab().save(file)

Swiftui popup when clicking text

I just started learning swiftui and im trying to figure out how to recreate the following popup when clicking on a word:
What i want to recreate is the ability to have this sort of popup directly under or above the specific word, whenever clicking on it.
How is this functionality called in swiftui? Now my best guess is that it uses a Menu which calls a function when clicking on it, that then displays popup, which is customized to make it look like it does now. Is that correct?
If not, can you point me to the right documentation or names of this functionality.

fltk widget order, button is hide under another widget

I am using fltk 1.3.2.
I have two widgets, one of them is Fl_Multiline_Output and other one is Fl_Button.
The button is a place on the the multiline_output.
When I click multiline_output, the button is disappeared.
I need to use always on top like speciality for my button.
It mustn't be hide.
Does anyone know fltk support this?
I have changed Fl_Multiline_Output to Fl_Text_Display, I put the text and deactivated it. Now, when I click Fl_Text_Display nothing is happen.
I changed to Fl_Text_Display because if I deactivate the Fl_Multiline_Output object, text color is changed. I chose Fl_Text_Display there is no problem with text color.

GXT, how to display the widgets labels with a VBOXLayout

I have been trying to resolve this by myself but I can't find any answers. I need the text fields the combo box, etc., to display its own label, but I can't put it to work on a panel different from the FormPanel (in which all works great). I'm trying to display the labels for a text field on a VBoxLayout but I don't find the way to do it.
I need to work with a VBoxLayout because I need the widgets to position in the middle of the form after the window is maximized or minimized and this layout is the only one that proves to work. Is there another way to accomplish this?
Add another LayoutContainer and then set the panel to use FormLayout for example
LayoutContainer innerPanel = new LayoutContainer();
innerPanel.setLayout(new FormLayout());
Now it will work just like a form panel.

Magnifier like feature inside popup window....how to?

I need to create a magnifier like feature in my app. Like the "loupe" effect on the iphone !
The problem is that I need to do that inside a popup window and I don't get how to make it work !
The popup window display a grid of colors that I generate and draw one by one using shapeDrawables. What I want is to display that color bigger, zoom on it when the user touch and move his finger around the popup window (color grid). The idea is to create a tracking-zooming effect on the colors so the user can see more clearly under wich color his finger is currently located.
Problems are :
I can't seem to create another popup window on top of this one, Android limitation I think ?
If I modify the current shapeDrawable, resize it, change the boundaries, It needs to re-display the popup window before it takes effect (which is not acceptable of course)
So, anyone knows of a way I could draw over that popup window ?
EDIT :
I've tried solving this issue using a Custom Toast object...But it doesn't quite do the trick. It works, but toast object appears slowly and so the touch motion is not in sync at all with the user movement over the color grid.
I'm not sure if this will help you or not, but you might be able to accomplish this by using a second Activity... this second Activity would use Android's translucent theme if you include the following attribute in your manifest:
<activity android:theme="#android:style/Theme.Translucent">
This second activity will now only contain what you place in your layout. That is... the "real" activity you're running will still be visible behind it (anywhere you don't cover it up with views in the new layout).
You also might prefer Theme.Dialog if you really want to resemble a popup.
Something to keep in mind if you take this approach is you will probably want to override onWindowFocusChanged() in the new activity, and finish() in the event of you losing focus. Additionally, you'll need to figure out how to share your data between the two activities.

Resources