Re: How can I draw colorful characters on Gtk2::Button?




On Thu, Mar 26, 2009 at 7:02 AM, xu zhou <redicaps gmail com> wrote:
Hi all, I am quite a new for Perl-Gtk2. I am tring to put some
colorful numbers on the button widget.
$button->set_label($style) dose not seem to work this way, it only
receive a string as the parameter, not a Gtk2::Lable.

The Gtk2::Button is a Gtk2::Bin which means you can call get_child() on a button and get the button's label. Once you get the label you can use set_markup() to colorize your text. To add a label to the button either use the constructor new_with_label() or create the label manually and add it with add().

I've attached a sample perl program that shows how to colorize a button.

--
Emmanuel Rodriguez

Attachment: color-button.pl
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]