After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620577 - Unable to retrieve the value of a field that is a fixed-size array
Unable to retrieve the value of a field that is a fixed-size array
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 626834
Blocks:
 
 
Reported: 2010-06-04 16:26 UTC by Toms Bauģis
Modified: 2011-10-21 18:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Toms Bauģis 2010-06-04 16:26:16 UTC
The fg/bg and other GtkStyleHelper attributes seem to be empty at all times.

Old code:

>>> import gtk
>>> print gtk.Style().fg
<gtk.GtkStyleHelper object at 0xb77eb818>


New code:

>>> from gi.repository import Gtk
>>> print Gtk.Style().fg
None
Comment 1 Simon van der Linden 2010-08-13 12:05:51 UTC
GtkStyleHelper is a PyGTK artifact. With dynamic bindings, you should expect a list of Gdk.Color.

As of today, Gtk.Style().fg returns an empty list. Is it correct?
Comment 2 Simon van der Linden 2010-08-13 13:05:18 UTC
I dug into _wrap_g_field_info_get_value and discovered that g_field_info_get_field ( (GIFieldInfo *) self->info, pointer, &value) sets value->v_pointer to 0, while it should not (the fg field should be a pointer, and is recognized as such by g_type_info_is_pointer).

In g_field_info_get_field, at line 196, G_STRUCT_MEMBER (gpointer, mem, offset) returns 0 while mem is 0x826e198 and offset is 12.
Comment 3 Simon van der Linden 2010-08-13 13:10:18 UTC
Actually, it's normal. I was wrong, the fg field should not be considered as a pointer since it is a fixed-size array.
Comment 4 Simon van der Linden 2010-08-13 13:37:52 UTC
Filed a bug in gobject-introspection. Depending on the solution, we might need to adapt _wrap_g_field_info_get_value too.
Comment 5 johnp 2010-12-17 00:07:07 UTC
The Gtk.Style structure is broken for GI although Gtk.Style().fg used to work.  In any case the structure should be gsealed and we should use accessors to get and set those values.  GI just can not support all the complexities of structs.  It especially doesn't know the difference between fixed structs and a pointer to an array.

The fix here is to provide a patch to gtk which allow access to each of the struct values.