0

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.

eexpress
  • 386
  • 1
  • 14

2 Answers2

0

gtk4 Window.resizable

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
0

You can use void gtk_window_set_default_size(GtkWindow* window, int width, int height) to set a different window height and width.