[Sugar-devel] EllipsizeMode error trying to port an activity to Gtk3

lionel at olpc-france.org lionel at olpc-france.org
Sun Jun 9 04:31:53 EDT 2013


 

Inspired by http://bugs.sugarlabs.org/ticket/3744, I’ve temporarily solved
the issue myself by commenting following lines in sugar3/graphics/palette.py

 

                Lionel.

 

 

133        #if text_maxlen > 0:

134        #    self._label.set_max_width_chars(text_maxlen)

135        #    self._label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)

136        labels_box.pack_start(self._label, True, True, 0)

137

138        self._secondary_label = Gtk.Label()

139        self._secondary_label.set_alignment(0, 0.5)

140

141        #if text_maxlen > 0:

142        #    self._secondary_label.set_max_width_chars(text_maxlen)

143        #    self._secondary_label.set_ellipsize(Pango.EllipsizeMode.END)

 

 

 

 

 

De : Lionel Laské [mailto:lionel.laske at gmail.com] De la part de
lionel at olpc-france.org
Envoyé : dimanche 9 juin 2013 09:47
À : sugar-devel at lists.sugarlabs.org
Objet : EllipsizeMode error trying to port an activity to Gtk3

 

 

Hi all,

 

I’m trying to port an activity to Gtk3 on the latest sugar-build.

I’ve imported all sugar3.*. 

I’ve substituted all gtk to gi.repository import gtk.

BTW I’m stick on a strange error on EllipsizeMode in Pango (see below).

Does I miss something?

 

                Lionel.

 

 

 

/usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning:
g_boxed_type_register_static: assertion `g_type_from_name (name) == 0'
failed

  import gobject._gobject

Traceback (most recent call last):

  File "/home/fedora/sugar-build/build/out/install/bin/sugar-activity", line
161, in <module>

    main()

  File "/home/fedora/sugar-build/build/out/install/bin/sugar-activity", line
156, in main

    instance = create_activity_instance(activity_constructor,
activity_handle)

  File "/home/fedora/sugar-build/build/out/install/bin/sugar-activity", line
42, in create_activity_instance

   activity = constructor(handle)

  File "/home/fedora/Activities/Roots.activity/activity.py", line 73, in
__init__

    activity_button = ActivityToolbarButton(self)

  File
"/home/fedora/sugar-build/build/out/install/lib/python2.7/site-packages/suga
r3/activity/widgets.py", line 74, in __init__

    toolbar = ActivityToolbar(activity, orientation_left=True)

  File
"/home/fedora/sugar-build/build/out/install/lib/python2.7/site-packages/suga
r3/activity/widgets.py", line 333, in __init__

    description_item = DescriptionItem(activity)

  File
"/home/fedora/sugar-build/build/out/install/lib/python2.7/site-packages/suga
r3/activity/widgets.py", line 233, in __init__

    self.set_tooltip(_('Description'))

  File
"/home/fedora/sugar-build/build/out/install/lib/python2.7/site-packages/suga
r3/graphics/toolbutton.py", line 93, in set_tooltip

    self.palette = Palette(tooltip)

  File
"/home/fedora/sugar-build/build/out/install/lib/python2.7/site-packages/suga
r3/graphics/palette.py", line 135, in __init__

    self._label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)

AttributeError: type object 'EllipsizeMode' has no attribute 'MIDDLE'

Exited with status 1, pid 17010 data (None, <open file '<fdopen>', mode 'w'
at 0x2438030>, dbus.ByteArray('2a46048ae724acdfc03e3b0b26e3e3ebacf4f38b',
variant_level=1))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130609/1827fef7/attachment-0001.html>


More information about the Sugar-devel mailing list