GtkStatusBar
| From: | Barry Mitchelson | Date: | Fri, 16 Mar 2001 10:59:07 +0000 |
| Subject: | GtkStatusBar | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-954@lists.php.net to get a copy of this message | ||
hello all,
I've been playing round with GtkStatusBar and was pondering the following :
to push and pop from the status bar you need to do the following :
$statusbar = &new GtkStatusBar();
$contextid = $statusbar->get_context_id("status");
$statusbar->push($contextid,"foo");
$statusbar->pop($contextid);
now, if i'm correct in thinking that the contextid is only for the status bar object you
create, then there is no need to specify the contextid when push and popping, and
for that matter removing. The statusbar functions would be easier to use if the contextid was
stored internally in the GtkStatusBar object.
I wrote a class extension to try this :
class GtkStatusBarEx extends GtkStatusBar
{
function GtkStatusBarEx ()
{
GtkStatusBar::GtkStatusBar();
$this->m_contextid = $this->get_context_id("status");
}
function push ($text)
{
return GtkStatusBar::push($this->m_contextid,$text);
}
function pop ()
{
GtkStatusBar::pop($this->m_contextid);
}
function remove ($msgid)
{
GtkStatusBar::remove($this->m_contextid,$msgid);
}
};
so the above code would now read :
$statusbar = &new GtkStatusBarEx();
$statusbar->push("foo");
$statusbar->pop();
this works fine, and I have used it in my own code.
What would be the chances of incorporating this into the standard GtkStatusBar class ?
barry
--
http://www.theshining.org