本文整理汇总了Python中quodlibet.qltk.entry.UndoEntry.set_placeholder_text方法的典型用法代码示例。如果您正苦于以下问题:Python UndoEntry.set_placeholder_text方法的具体用法?Python UndoEntry.set_placeholder_text怎么用?Python UndoEntry.set_placeholder_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quodlibet.qltk.entry.UndoEntry
的用法示例。
在下文中一共展示了UndoEntry.set_placeholder_text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SubmitErrorDialog
# 需要导入模块: from quodlibet.qltk.entry import UndoEntry [as 别名]
# 或者: from quodlibet.qltk.entry.UndoEntry import set_placeholder_text [as 别名]
class SubmitErrorDialog(Gtk.MessageDialog):
RESPONSE_SUBMIT = 1
def __init__(self, parent, error_text):
main_text = _("Submit Error Report")
secondary_text = _(
"Various details regarding the error and your system will be send "
"to a third party online service "
"(<a href='https://www.sentry.io'>www.sentry.io</a>). You can "
"review the data before sending it below.")
secondary_text += u"\n\n"
secondary_text += _(
"(optional) Please provide a short description of what happened "
"when the error occurred:")
super(SubmitErrorDialog, self).__init__(
modal=True, text=main_text, secondary_text=secondary_text,
secondary_use_markup=True)
self.set_transient_for(parent)
self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
self.add_button(_("_Send"), self.RESPONSE_SUBMIT)
self.set_default_response(Gtk.ResponseType.CANCEL)
area = self.get_message_area()
self._entry = UndoEntry()
self._entry.set_placeholder_text(_("Short description…"))
area.pack_start(self._entry, False, True, 0)
expand = TextExpander(_("Data to be sent:"), error_text)
area.pack_start(expand, False, True, 0)
area.show_all()
self.get_widget_for_response(Gtk.ResponseType.CANCEL).grab_focus()
def get_comment(self):
"""Returns the user provided error description
Returns
text_Type
"""
return self._entry.get_text()