Re: color of focus rectangle



Patrick Schweiger <pks@timing.com> writes: 
> I took a look at the files you recommended and see how the
> focus rectangle is drawn in the end. What I haven't found
> (or investigated thoroughly, once again) is if GtkStyleClass
> default_class is the only one in use throughout the gtk
> library.
>

The default class is always used unless a theme engine is loaded. A
gtkrc can specify which engine to load - GTK doesn't ship with any
extra engines though, so unless you install some, you won't need to
worry about it. 
 
> I haven't found much about theme engines on the web, went to
> gtk.themes.org and found little information on how to go
> about writing one there. Will you recommend a better place?
> 

Sadly this is more or less a "read the source" issue. But in essence
you just implement the GtkStyleClass virtual table.

There are a number of examples available on gtk.themes.org, copying
those would be the simplest way to proceed.

> I do use gtk_rc_parse to control the appearance of the
> controls. The only things the rc file changes at this point
> are colors and fonts. In fact the rc file is where the black
> background originates. Having looked at gtkstyle.[hc] I
> don't quite see how the rc file could be used to affect the
> color of the focus rectangle though.
>

The RC file doesn't have any syntax for this - the color is hard coded
in the GtkStyleClass routines, so you can only change it by modifying
C code.

> thanks for the two quick-fixes ... I might wind up
> implementing either of them if the additional information
> (apologies for not including it in the first place as it
> sounds like it's relevant information after all)
> 

If I was doing it, I'd just hack GTK itself, I think. With Red Hat
Linux for example you can even modify the RPM then set up a custom
install that uses your new RPM (though, don't ask me for details on
how to do that, but I know you can ;-)

Havoc




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