The proper way to integrate self-made widgets with themes



Hello all.

In the process of making a bunch of widgets I have stumbled upon this
issue: I need to paint various parts of my widget, but I would like to
make the color of the parts controlled by the theme. I.e. the properties I
want to deal with are extra, self-invented properties besides the usual
style properties.

(Note: I am using PyGTK 2.12, GTK 2.10 on Arch Linux)

I have figured out how to manually load a theme-file accompanying my
application (by setting the environment variable GTK2_RC_FILES to ./gtkrc
before initializing gtk)
However I cannot insert my own property-names in such a file. The
following gives rise to a syntax error:

    # My Properties
    scalartrack_segment_handle_size = 5

Besides I wouldn't know how to get those properties out again so I can use
them in an expose event

So...
I am asking for the canonical way to implement new widgets and push the
choice of color, size and pixmap-overlays to the theme-designer. The
alternative is drawing with libcairo and using hardwired style properties.

Regards, Rene Jensen





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