Re: how can i set the background color of GtkText?



Robert Nikander <nikander mindspring com> writes:

On 2001.12.29 13:33 anuradha arora wrote:
hi!
Please could u tell me if there is any way to set the
base color of the text? is it possible?
regrads,
anuradha.

On 1.3 (and maybe 1.2, I don't know), in the GtkWidget class,
gtk_widget_modify_base(...) and gtk_widget_modify_text(...)
can set the color of the text and the text background.  I don't know
why "base" and "text" are treated differently than foreground and
background, or why they are in the widget class when they seem to
apply only to text widgets.  Anyone?

 - They are separate, because:

   a) there are widgets (like GtkText) that use both
   b) GTK+ by default assigns no overriding styles to widgets,
      so different color backgrounds need different style members.

 - They apply to GtkEntry, GtkTextView, GtkList, GtkCList, 
   GtkTreeView, GtkText ..... 

You can set them just like you set the foreground and background -
just change 'fg' to 'text' and 'bg' to 'base' in whatever
method you are using ... since the original question mentioned setting 
the background, I assumed that some method to do that had been
found (rc files, gtk_widget_modify_style(), gtk_widget_set_style()...)

Regards,
                                        Owen



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