Here has a gtk4 window (ApplicationWindow
) which contain a gtk Label
. When I fill a long multi-line text in the label, the window auto become large width and height, this no problem. But I fill a short text in the label again, I want the window resize to smaller to fit the label size.
Gtk.Widget.width_request
no effect on both label and window.
Asked
Active
Viewed 399 times
0

eexpress
- 386
- 1
- 14
2 Answers
0
Gtk.Window:resizable
Type: gboolean
Description
If TRUE, users can resize the window.
Setter method
gtk_window_set_resizable
Getter method
gtk_window_get_resizable

Anthony L
- 112
- 6
-
I think resizable is true by default. – eexpress May 09 '22 at 17:07
0
You can use void gtk_window_set_default_size(GtkWindow* window, int width, int height)
to set a different window height and width.

Roman Kireev
- 1
- 1