python - Gtk notifications don't display body holding '<' -
i'm trying display notifications notification module of pygobject (version 3.16) in python. code works well, except when there <
in body message. in case, body not displayed.
for example code, ok:
from gi.repository import gtk, notify def callback(notification, action_name): notification.close() gtk.main_quit() notify.init('test') notification = notify.notification.new('title', 'body') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show() gtk.main()
but 1 there problem:
from gi.repository import gtk, notify def callback(notification, action_name): notification.close() gtk.main_quit() notify.init('test') notification = notify.notification.new('title', '<body') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show() gtk.main()
i that:
when <
in title, or when use >
there no problem.
i tried escape <
, didn't anything. so, how display body text containing <
?
i've noticed in gtk there html code, when using set_markup
.i tried hmtl equivalent <
, worked fine:
from gi.repository import gtk, notify def callback(notification, action_name): notification.close() gtk.main_quit() notify.init('test') notification = notify.notification.new('title', '<body>') notification.set_timeout(notify.expires_never) notification.add_action('quit', 'quit', callback) notification.show()
Comments
Post a Comment