eexpress
eexpress

Reputation: 456

How to resize a Gtk4 window?

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.

Upvotes: 0

Views: 1009

Answers (2)

Roman Kireev
Roman Kireev

Reputation: 1

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

Upvotes: 0

Anthony L
Anthony L

Reputation: 132

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

Upvotes: 0

Related Questions