I’m trying to obtain the selection color of a Gtk3 IconView in python but I’m confused how to interpret the existing C++ documentation and how it relates to Python.
My current python code is as follows:
color = self.iconview.get_style().bg[Gtk.StateType.SELECTED]
This works ok in Ubuntu 12.04 – Gnome/Gtk 3.2 I think.
However the documentation here says get_style is deprecated since 3.0
In Ubuntu 12.10 which uses the latest GTK, the above does not work – I get an error:
CRITICAL **: StackOverflow protection. Can't copy array element into GIArgument
The document says I should use GtkStyleContext – but how?
Can anyone give me a concrete python example?
In C:
Python translation by fossfreedom:
It appears that the
GtkStylestruct from gtk2 was simply replaced with the more modernGtkStyleContextclass in gtk3