/* Example of a CSS style sheet with a custom style property.
*
* The name of the style property must have its canonical form, i.e. characters
* other than ASCII letters, digits, and hyphens must be replaced by hyphens.
*/
* {
/* -<widget class name>-<style property canonical name>: <value>; */
-gtkmm__CustomObject_mywidget-example-scale: 920;
}
#my-widget {
background-color: rgb(255,0,0);
color: rgb(0,0,255);
}
I do not get any error on loading the css file. The Button does not change the color to red.
Deprecated: 3.16: This function is not useful in the context of CSS-based
rendering. If you wish to change the way a widget renders its background
you should use a custom CSS style, through an application-specific
Gtk::StyleProvider
<https://developer.gnome.org/gtkmm/stable/classGtk_1_1StyleProvider.html> and
a CSS style class. You can also override the default drawing of a widget
through the Gtk::Widget::signal_draw()
<https://developer.gnome.org/gtkmm/stable/classGtk_1_1Widget.html#ab0a7d34fe7ae7a83fdb1e1ddd223e8f4>signal,
and use Cairo
<http://www.cairographics.org/documentation/cairomm/reference/namespaceCairo.html>
to
draw a specific color, regardless of the CSS style.
Can anyone guide me with a working example I can’t seem to find a complete working code anywhere. Trying put stuff ending up no result at all
I did set the label for the button first.
Then set name.
Still not working
Can you please try out it out from your end and paste a basic small snippet here for my reference so that I can check if it works
Can you please try and provide a snippet for a working code of button change color in gtkmm 3?
It’s getting a lot confusing now only for button. custom widget examples works fine but this button is a pain.