sugarlabs / readetexts

Read Etexts Activity -- Read Plain Text books published by Project Gutenberg.
GNU General Public License v2.0
2 stars 7 forks source link

Gtk warnings #24

Open sparshg opened 1 year ago

sparshg commented 1 year ago

Found while updating flatpak version, also happens in when run natively with sugar-activity3

(sugarapp:2): Gtk-WARNING **: 04:49:02.700: Failed to set text '<span foreground='black' size='14000'>' from markup due to error parsing markup: Error on line 1 char 55: Element “markup” was closed, but the currently open element is “span”
no font size found
All done!
/app/share/sugar/activities/ReadETexts.activity/ReadEtextsActivity.py:554: Warning: g_value_get_int: assertion 'G_VALUE_HOLDS_INT (value)' failed
  self.num_page_entry.props.text = str(current_page + 1)
quozl commented 1 year ago

Yes, this first warning is caused by calling Gtk.Label.set_markup with unbalanced tags. Also, the code calls set_markup then calls set_text, in two places, when it should only call set_markup. GTK has changed since this code was written. See https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Label.html#Gtk.Label.set_markup for current semantics.

The cause second warning isn't clear to me, it's just a Gtk.Entry, but some experimentation with the affected line may help.