NAME
Gtk2::Ex::Statusbar::Message -- message displayed in a Statusbar
SYNOPSIS
use Gtk2::Ex::Statusbar::Message;
my $msg = Gtk2::Ex::Statusbar::Message->new (statusbar => $statusbar);
$msg->set_message ('Hello World');
$msg->set_message (undef);
OBJECT HIERARCHY
Gtk2::Ex::Statusbar::Message
is a subclass of Glib::Object
,
Glib::Object
Gtk2::Ex::Statusbar::Message
DESCRIPTION
This is an object-oriented approach to a message in a Gtk2::Statusbar
.
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.
FUNCTIONS
$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');
$msg->set_message($str)
-
Set the message string to display, as per the
message
property below.
PROPERTIES
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.
SEE ALSO
Gtk2::Ex::Statusbar::DynamicContext, Gtk2::Ex::Statusbar::MessageUntilKey
BUGS
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.
HOME PAGE
http://user42.tuxfamily.org/gtk2-ex-widgetbits/index.html
LICENSE
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 http://www.gnu.org/licenses/.