当前位置: 首页>>代码示例>>Python>>正文


Python UndoEntry.set_placeholder_text方法代码示例

本文整理汇总了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()
开发者ID:LudoBike,项目名称:quodlibet,代码行数:49,代码来源:ui.py


注:本文中的quodlibet.qltk.entry.UndoEntry.set_placeholder_text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。