Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add children to a StatusBar in Glade3?

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.

like image 792
Stefano Palazzo Avatar asked Jan 04 '12 11:01

Stefano Palazzo


1 Answers

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

like image 126
Stefano Palazzo Avatar answered Oct 24 '22 01:10

Stefano Palazzo