Setting background of ToggledButton on pressed



After a fairly frustrating day working out how to change the background on togglebutton when pressed, here is my code, if it helps anyone

my $display = Gtk3::Gdk::Display::get_default ();
my $screen = $d->get_default_screen;
my $provider = Gtk3::CssProvider->new;
$provider->load_from_data ( 'button.toggle#fcopy:checked {color: blue;background-image: image(yellow);font-weight: bold} entry { color: blue; background-color: yellow; }');
Gtk3::StyleContext::add_provider_for_screen ($screen, $provider, Gtk3::STYLE_PROVIDER_PRIORITY_USER);

Notes
button.toggle is the class for for toggledbutton
#fcopy is the name I have given to a button
:checked is the correct action
background-image: image(yellow) is how to set the background, background-color does not work

Mike


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