Re: StatusBar Color
| From: | kksou | Date: | Mon, 18 Dec 2006 06:52:38 +0000 |
| Subject: | Re: StatusBar Color | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7519@lists.php.net to get a copy of this message | ||
AngeloP wrote:
>
> Hi,
> anyone knows the method to change the background color to a status bar now
> is transparent and I see the picture or color of main window ?
>
> This doesn't have none efect
>
> ->modify_bg(Gtk::STATE_NORMAL, GdkColor::parse("#5C86C4"));
> ->modify_base(Gtk::STATE_NORMAL, GdkColor::parse('#dddddd'));
>
Hi,
Stuff the status bar inside a GtkEventBox, and set the bg of the eventbox.
Here's a sample code:
<?php
$window = new GtkWindow();
$window->set_size_request(400, 200);
$window->connect_simple('destroy', array('Gtk','main_quit'));
$window->add($vbox = new GtkVBox());
// display title
$title = new GtkLabel("Window with status area");
$title->modify_font(new PangoFontDescription("Times New Roman Italic 10"));
$title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff"));
$title->set_size_request(-1, 40);
$vbox->pack_start($title, 0, 0);
$vbox->pack_start(new GtkLabel('your body contents'));
// setup status area
$status = new GtkStatusbar(); // note 1
$eventbox = new GtkEventBox();
$eventbox->add($status);
$vbox->pack_start($eventbox, 0, 0); // note 2
$eventbox->modify_bg(Gtk::STATE_NORMAL, GdkColor::parse('#ffff00')); // note
3
// display a message
$context_id = $status->get_context_id('msg1'); // note 4
$status->push($context_id, 'this is msg 1'); // note 4
$window->show_all();
Gtk::main();
?>
Sample output:
http://www.kksou.com/php-gtk2/gif/0122.gif
More explanations here:
http://www.kksou.com/php-gtk2/articles/have-a-status-area-using-GtkStatusbar.php
Regards,
/kksou
--
View this message in context: http://www.nabble.com/StatusBar-Color-tf2836358.html#a7924254
Sent from the Php - GTK - General mailing list archive at Nabble.com.