Setting background of ToggledButton on pressed

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Setting background of ToggledButton on pressed

Gtk+ - Perl mailing list
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

_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list