[gtkmm] Troubles using my own style and changing togglebutton label text



Dear gtkmm members,

I have tried to modify a togglebutton that way, that it has 2 different
(background) colors and labels (depending on its state).

First problem: changing the color
I have made a .rc file with this content:
style "red_green_togglebutton"
{
	fg[NORMAL] = { 0.74, 0.85, 0.93 }
	bg[NORMAL] = { 0.48, 0.52, 0.58 }
	fg[ACTIVE] = { 1.0, 0, 0 }
	bg[ACTIVE] = { 1.0, 0, 0 }
}
In the constructor of my base class I do the following:
...
Gtk::ToggleButton *startstopbutton = manage(new class Gtk::ToggleButton("Test"));
gtk_rc_parse("my_resource_file.rc");
startstopbutton->set_name("red_green_togglebutton");
...
But there's no difference to the button, it's still 'grey in grey'.
What am I doing wrong?

Second problem: changing togglebutton label text
I'd also like to change the button labeling when getting pressed. My idea was
to use Gtk::Label::set_text but how can I apply this to the button label and
not to the button itself (an example would help!).

Thanks to all that try to help,
sincerely,
Jeffrey Rush.

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com




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