Re: Replacement for gtk_widget_override_background_color() with GtkTextView



On Fri, 2015-02-13 at 14:50 +0000, Emmanuele Bassi wrote:
hi;

On 11 February 2015 at 13:08, Murray Cumming <murrayc murrayc com> wrote:
The gtk_widget_override_*() functions were recently deprecated:
https://git.gnome.org/browse/gtk+/commit/?id=63efdca2
(These had themselves replaced gtk_widget_modify_*():
https://git.gnome.org/browse/gtk+/commit/?id=f383e6b0 )

I'd like to improve the deprecation documentation to give more exact
clues about what people should do.

there are two ways to replace gtk_widget_modify_background_color() —
though, obviously, the actual reply would be "don't":

I too would discourage it in almost all cases but there are legitimate
uses in specialist applications.

 • you can either provide a fragment of CSS to style the widget yourself
 • you can override the GtkWidget::draw signal, and paint the color
yourself using Cairo

But I don't know what CSS would replace
gtk_widget_override_background_color() for a GtkTextView. If I use
"background-color: #whatever" then only the background of the content's
text is colored, not the background of the whole area.

what does "the whole area" mean, in this context? the text view may
have some margin, which does not get painted with the background
color, as per CSS spec.

if you want to paint the area beneath the margin, you'll have to draw
on the parent widget, not on the GtkTextView.

These screenshots show the difference. Additionally, on the
obviously-wrong one, the text wrapping also changes during every mouse
over.

However, while getting these screenshots I noticed that the change is
caused by different GTK+ versions, regardless of what API I use. I'll
try to narrow down what caused the change and file a bug.

Thanks.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com

Attachment: screenshot_gtktextview_background_gtk3p12p2.png
Description: PNG image

Attachment: screenshot_gtktextview_background_gtk3p15p5.png
Description: PNG image



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