Retrieving colours from Gtk Theme without a base widget?



Hi all,

I'm trying to query some colours from the current gtk theme, from an
extension. For example: 'gtk:fg[NORMAL]'.

The only way I've found so far (through docs/searching the net) seems
to be to create a widget, map it to the screen, and then get its
style:

let widget = new Gtk.SomeWidget();
// somehow map to screen from within an extension
// retrieve the widget's style context
let style = widget.get_style().context;
style.get_color(Gtk.StateFlags.NORMAL);

My question is - is there some way I can query the colours without
creating the Gtk widget? (I'm mucking around with some
St.DrawingArea/imports.cairo.Context and want to query colours from
the gtk theme so I can match).

cheers


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