Re: How to setup label foreground colour ?
- From: Pavel Rousnak <pr rpb ru>
- To: "Vladimir V. Markevich" <markj LinS ospu odessa ua>
- Cc: gtk-perl-list gnome org
- Subject: Re: How to setup label foreground colour ?
- Date: Thu, 30 Aug 2001 17:49:20 +0400
Hi,
I need to setup colour for label widget, (a couple of labels). I want
to use my own style different from default only with colour.
My piece of code is :
...
$style = $label->get_style();
$newstyle = $style;
$newstyle->{'fg'} = $color; # the color is gdk colour allocated above
$label->set_style($newstyle);
...
And it does not work ! :(
Please, any suggestion, will be fine !
Styles contain arrays of fg/bg colors: a color per a state.
So you should use the function
Gtk::Gdk::Color $style->fg ($state, $new_color)
Try the following:
...
$style = $label->get_style();
$newstyle = $style->copy();
$newstyle->fg('normal', $color);
$label->set_style($style);
...
--
Best regards
Pavel.
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]