Gtk2::Ex::Statusbar::Message -- message displayed in a Statusbar


 use Gtk2::Ex::Statusbar::Message;
 my $msg = Gtk2::Ex::Statusbar::Message->new (statusbar => $statusbar);
 $msg->set_message ('Hello World');
 $msg->set_message (undef);


Gtk2::Ex::Statusbar::Message is a subclass of Glib::Object,



This is an object-oriented approach to a message in a Gtk2::Statusbar.

    Message object             +--------------------+
      "hello"       ----->     | hello              |

A Message object holds a string and a target statusbar widget which is where it should display. If the Message object is destroyed the string is removed from the statusbar.

The idea is that it can be easier to manage the lifespan of an object than to keep a $message_id from the statusbar and remember to pop or remove when a job object or similar ends or is destroyed.


$msg = Gtk2::Ex::Statusbar::Message->new (key=>value, ...)

Create and return a new Message object. Optional key/value pairs set initial properties as per Glib::Object->new.

    my $msg = Gtk2::Ex::Statusbar::Message->new
                (statusbar => $statusbar,
                 message   => 'Hello World');

Set the message string to display, as per the message property below.


statusbar (Gtk2::Statusbar or undef)

The Statusbar widget to display, or undef not to display anywhere.

The Message object only keeps a weak reference to this statusbar.

message (string or undef)

The message string to display, or undef not to add anything to the Statusbar.

Currently an empty string is treated the same as undef, meaning it's not added to the Statusbar.



Gtk2::Ex::Statusbar::DynamicContext, Gtk2::Ex::Statusbar::MessageUntilKey


If the statusbar property changes to becomes undef due to the statusbar weakening away then a notify signal is not emitted for the property change.

Changing the Message object string raises the message to the top of the statusbar stack. Sometimes this is good, but it might be better to keep the same position, if that could be done easily.



Copyright 2008, 2009, 2010, 2011, 2012 Kevin Ryde

Gtk2-Ex-WidgetBits is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Gtk2-Ex-WidgetBits is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Gtk2-Ex-WidgetBits. If not, see