The statusbar can only display one message at a time. What's more, the statusbar can be disabled. Statusbar messages from one extension can conflict with another — and all extensions can conflict with Epiphany's standard statusbar messages. There are many reasons not to write statusbar messages in your extension.
Writing statusbar messages is one of the easiest things to do from an extension. Just be sure to understand GtkStatusbars: in a given context, there is a stack of messages. Only the top message from all contexts can be shown at a time, and messages can be pushed and popped to and from the stack on any given context.
This sample code should give some ideas:
Example 4.6. Manipulating the statusbar
#define STATUSBAR_CONTEXT "EphyFooStatusbarContext"
static void
write_statusbar_message (EphyWindow *window, const char *message)
{
GtkStatusbar *statusbar;
guint context_id;
statusbar = GTK_STATUSBAR (ephy_window_get_statusbar (window));
g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
context_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (window),
STATUSBAR_CONTEXT));
g_return_if_fail (context_id != 0);
/* Keep a maximum of one element on the stack */
gtk_statusbar_pop (statusbar, context_id);
/* Write our message */
gtk_statusbar_push (statusbar, context_id, message);
}
static void
remove_statusbar_message (EphyWindow *window)
{
GtkStatusbar *statusbar;
guint context_id;
statusbar = GTK_STATUSBAR (ephy_window_get_statusbar (window));
g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
context_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (window),
STATUSBAR_CONTEXT));
g_return_if_fail (context_id != 0);
gtk_statusbar_pop (statusbar, context_id);
}
static void
impl_attach_window (EphyExtension *extension,
EphyWindow *window)
{
GtkStatusbar *statusbar;
guint context_id;
statusbar = GTK_STATUSBAR (ephy_window_get_statusbar (window));
g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
context_id = gtk_statusbar_get_context_id (statusbar, "Foo extension");
g_object_set_data (G_OBJECT (window), "foo-statusbar-cid", GUINT_TO_POINTER (context_id));
}
static void
impl_detach_window (EphyExtension *extension,
EphyWindow *window)
{
remove_statusbar_message (window);
}