GtkWindow is the top-level container widget that represents a window on the desktop. It serves as the root container for your application’s UI and handles window management features like title, size, and modality.
Props
The title of the window displayed in the title bar.
The default width of the window in pixels.
The default height of the window in pixels.
If
true, the window is modal and blocks interaction with other windows.The child widget to display inside the window. Windows can only have a single direct child.
Inherited Props
GtkWindow extends GtkWidget and inherits all its props including layout, styling, and event handling properties.
Usage
Basic Window
Modal Window
Modal windows block interaction with other windows until closed:Instance Methods
When using a ref, you can access these methods on theGtkWindowImpl instance:
present()
Presents the window to the user, bringing it to the front and giving it focus.close()
Closes the window.Notes
Windows can only have a single direct child. Use container widgets like
GtkBox or GtkStack to add multiple widgets.