Status of GtkStatusbar

I know that in Gtk4, the GtkStatusbar widget has been marked as deprecated and will be removed in Gtk5.

What is the plan for Gtk5? What should applications which now use GtkStatusbar be using in Gtk5? I’d like to understand so I can “future-proof” my app.

Reminder: the development of GTK5 has not started, yet.

The real question is: why are you using GtkStatusbar right now? What’s the design of your application, and why does it involve an area showing a label of text?

I am using it for the purposes for which it was even present - transient messages that are not necessarily errors.

The recommended way to achieve that is in app notifications; libadwaita has toasts.

If you can’t use libadwaita, then you can re-implement them using a GtkOverlay and a box with a label, and applying a custom style.

1 Like

Hi,

Originally (i.e. decades ago) the main point of the GtkStatusbar was that it had a resize handle, for changing the window size.

Nowadays, windows can be resized at any of their borders, so functionally the GtkStatusBar is nothing more than a disguised GtkLabel.

A simple Label, with a custom CSS for min-height, padding and maybe a top border will be a good drop-in replacement.
To avoid wasting space, in-app notifications can be considered, as suggested by ebassi.

1 Like

I see. Thank you.

One thing is not clear to be about Toast. Every time I want to display a notification, I have to create a new Toast and add it to the ToastOverlay, correct? If so, do I have to explicitly destroy the Toast when the message is done displaying?

No: toasts have a timeout that controls when (or if) they disappear.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.