Re: How to change color of Gtk::RadioButton's label?



That IS strange Marco, because my code is virtually identical to yours
and all I get is a blank check button.  Could the desktop theme I'm
using be overriding this somehow?

Bob

Marco wrote:

> On Mon, 19 Dec 2005 02:58:49 -0600, Bob Caryl <bob fis-cal com> wrote:
>
>> Sorry Marco,
>>
>> Your code doesn't work;  it compiles, but I end up with a check button
>> that has no label at all, unless I create one in the CheckButton
>> constructor itself.    Then, that label has not got the background color
>> specified in the set_markup string.
>>
>> I have been trying to get a Pango::Layout for a checkbutton, and the
>> code to get it seems to compile and run, but the attribute list returned
>> by the layout is NULL, hence my change to the background color attribute
>> is fruitless.  A call to modify_bg for the checkbutton widget merely
>> changes the frame color of the check box itself.  The label remains
>> unfazed.  Can anyone point me to a URL that has a good Pango tutorial?
>> Maybe I can dig through that and finally come up with an answer to
>> Volosatov's original question.
>>
>> Bob
>>
>
> That's strange Bob, it works here, i end up with a nice checkbutton
> with a  blue label.
> You are talking about the background color, i'm trying to change the 
> foreground color.
>
> here's the code again (this time i tested it):
>
> #include <gtkmm.h>
>
> int main(int argc, char**argv)
> {
>   Gtk::Main kit(argc, argv);
>
>   Gtk::Window win;
>   Gtk::CheckButton check;
>   Gtk::Label* l=Gtk::manage(new Gtk::Label);
>   l->set_markup("<span color = \"blue\"> blue text </span>");
>   check.add(*l);
>   win.add(check);
>   win.show_all_children();
>   kit.run(win);
>
>   return 0;
> }
>
>



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