How do I add children to a StatusBar in Glade3?
Asked Answered
L

1

10

In GTK2, a StatusBar was just a simple container like an HBox. Glade 3 (gtk3) now shows this message when I try to add child widgets to my status bar:

Widgets of type Status Bar need placeholders to add children.

What are placeholders?

I prefer to build the UI entirely in Glade, but If that doesn't work anymore, building it in code is fine too. I'm using Python 3.2 and Gtk via GObject introspection.

Lennox answered 4/1, 2012 at 11:55 Comment(0)
L
6

In Gnome 3, status bars are no longer containers; they're more like stacks of messages. To display a message, get a fresh context id and push the message onto the stack of messages associated with the statusbar:

context_id = statusbar.get_context_id("progress_message")
statusbar.push(context_id, "Almost done...")

or

statusbar.push(1, "Almost done...")

And to remove the message again, use statusbar.pop(1). Having things like progress bars or images in the statusbar is therefore no longer possible.

See also: GtkStatusbar at the Gnome Dev Center

Lennox answered 6/1, 2012 at 13:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.