Re: Unable to set background color for button





just search for the C class name, e.g. /GtkButton/

https://developer.gnome.org/gtk3/stable/GtkButton.html

OK, found the page, but I did not find CSS things like "background-color".



in CSS. either add a line

/background-image: none/

or use the shorthand /background:/ instead of /background-color:/ as
that will achieve the same effect


OK, my understanding is that:

    css_provider->load_from_data("button {background-image: none;}
button {background-color: #ff0000;}");


can be reduced to:

    css_provider->load_from_data("button {background: #ff0000;}");

with the same effect. I am right?


But I still can't find that in the docs. What I see in the doc you link
me to is:

"GtkButton has a single CSS node with name button. The node will get the
style classes .image-button or .text-button, if the content is just an
image or label, respectively. It may also receive the .flat style class.

Other style classes that are commonly used with GtkButton include
.suggested-action and .destructive-action. In special cases, buttons can
be made round by adding the .circular style class."

But here I can't see something like "background-image" or "
background-color:" or something. Maybe there is some other page which
documents the "style class .text-button". But that page is not linked
nor I can find it.

Sorry again! But I want to be able to find the information my self :-) I
can't believe that it is so hard to get the right links!



Regards
Klaus


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