Skip to content

Commit

Permalink
[gi-overrides] handle unichar gvalues when setting treemodels
Browse files Browse the repository at this point in the history
  • Loading branch information
John (J5) Palmieri committed Mar 7, 2011
1 parent 6367bff commit 7e9483f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gi/overrides/Gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,16 @@ def _convert_value(self, treeiter, column, value):
elif type_ == GObject.TYPE_UCHAR:
value_container.set_uchar(value)
value = value_container
elif type_ == GObject.TYPE_UNICHAR:
cmp_classes = [str]
if sys.version_info < (3, 0):
cmp_classes.append(unicode)

if isinstance(value, tuple(cmp_classes)):
value = ord(value[0])

value_container.set_uint(value)
value = value_container
elif type_ == GObject.TYPE_UINT:
value_container.set_uint(value)
value = value_container
Expand Down

0 comments on commit 7e9483f

Please sign in to comment.