Re: How to change color of Gtk::RadioButton's label?
- From: "Marco Scholten" <mscholtn xs4all nl>
- To: <bob fis-cal com>
- Cc: gtkmm-list gnome org
- Subject: Re: How to change color of Gtk::RadioButton's label?
- Date: Tue, 20 Dec 2005 16:21:04 +0100
From: "Bob Caryl" <bob fis-cal com>
To: "Marco Scholten" <mscholtn xs4all nl>
Cc: <gtkmm-list gnome org>
Sent: Tuesday, December 20, 2005 3:55 PM
Subject: Re: How to change color of Gtk::RadioButton's label?
Hello Marco,
If the Pango::Layout is not useable for a Gtk::Label, then why oh why
does Gtk::Label::get_layout exist? If Pango cannot be used to display a
Gtk::Label's text, then why in the wide wide world is the method listed
in the Gtk::Label documentation with the comment: "Get's the
Pango::Layout used to display the label."
Doesn't it?
My research shows that Gtk::Button does not have this method
specifically, nor does it exist in its ancestry. Incidentally,
Gtk::EventBox also lacks get_layout specifically or in its ancestry.
So, it appears that I'm back to either obtaining a handle to the button
class's internal label widget, or creating and adding my own label to
the button (which inexplicably has not worked for me so far.)
Marco, I greatly appreciate your efforts here, but I cannot help but
believe that this can be done somehow with Pango.
Sure it can, with pango markup like this:
Gtk::CheckButton b;
Gtk::Label* l=Gtk::manage(new Gtk::Label);
l->set_text("<span background = \"blue\"> blue background </span>");
l->set_use_markup(true);
b.add(*l);
But this will not work for since adding a label to a button will not
work for you, what if you add a call to show_all_children() for the window?.
--
Marco
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]