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


Python Button.set_tooltip_text方法代码示例

本文整理汇总了Python中quodlibet.qltk.x.Button.set_tooltip_text方法的典型用法代码示例。如果您正苦于以下问题:Python Button.set_tooltip_text方法的具体用法?Python Button.set_tooltip_text怎么用?Python Button.set_tooltip_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在quodlibet.qltk.x.Button的用法示例。


在下文中一共展示了Button.set_tooltip_text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from quodlibet.qltk.x import Button [as 别名]
# 或者: from quodlibet.qltk.x.Button import set_tooltip_text [as 别名]
    def __init__(self, filename=None, button=True, completion=None,
            accel_group=None):
        super(SearchBarBox, self).__init__(spacing=6)

        if filename is None:
            filename = os.path.join(const.USERDIR, "lists", "queries")

        combo = ComboBoxEntrySave(filename, count=8,
            validator=Query.is_valid_color, title=_("Saved Searches"),
            edit_title=_("Edit saved searches..."))
        combo.enable_clear_button()

        self.__refill_id = None
        self.__combo = combo
        entry = combo.child
        self.__entry = entry

        if completion:
            entry.set_completion(completion)

        self.connect('destroy', lambda w: w.__remove_timeout())

        self.__sig = combo.connect('changed', self.__text_changed)

        entry.connect('clear', self.__filter_changed)
        entry.connect('backspace', self.__text_changed)
        entry.connect('populate-popup', self.__menu)
        entry.connect('activate', self.__filter_changed)
        entry.connect('activate', self.__save_search)
        entry.connect('focus-out-event', self.__save_search)

        label = gtk.Label(_("_Search:"))
        label.set_use_underline(True)
        label.connect('mnemonic-activate', self.__mnemonic_activate)
        label.set_mnemonic_widget(entry)
        self.pack_start(label, expand=False)

        self.pack_start(combo)

        # search button
        if button:
            search = Button(_("Search"), gtk.STOCK_FIND,
                            size=gtk.ICON_SIZE_MENU)
            search.connect('clicked', self.__filter_changed)
            search.set_tooltip_text(_("Search your library"))
            self.pack_start(search, expand=False)

        if accel_group:
            key, mod = gtk.accelerator_parse("<ctrl>L")
            accel_group.connect_group(key, mod, 0,
                                      lambda *x: label.mnemonic_activate(True))

        self.show_all()
开发者ID:silkecho,项目名称:glowing-silk,代码行数:55,代码来源:searchbar.py

示例2: create_apply_button

# 需要导入模块: from quodlibet.qltk.x import Button [as 别名]
# 或者: from quodlibet.qltk.x.Button import set_tooltip_text [as 别名]
 def create_apply_button():
     vbox = Gtk.VBox(spacing=12)
     apply = Button(_("_Apply"))
     apply.set_tooltip_text(
         _("Apply current configuration to song list, "
           "adding new columns to the end"))
     apply.connect('clicked', self.__apply, buttons)
     # Apply on destroy, else config gets mangled
     self.connect('destroy', self.__apply, buttons)
     b = Gtk.HButtonBox()
     b.set_layout(Gtk.ButtonBoxStyle.END)
     b.pack_start(apply, True, True, 0)
     vbox.pack_start(b, True, True, 0)
     return vbox
开发者ID:faubiguy,项目名称:quodlibet,代码行数:16,代码来源:prefs.py

示例3: __init__

# 需要导入模块: from quodlibet.qltk.x import Button [as 别名]
# 或者: from quodlibet.qltk.x.Button import set_tooltip_text [as 别名]
        def __init__(self):
            super(PreferencesWindow.SongList, self).__init__(spacing=12)
            self.set_border_width(12)
            self.title = _("Song List")

            # Behaviour
            vbox = Gtk.VBox(spacing=6)
            c = CCB(_("_Jump to playing song automatically"),
                    'settings', 'jump', populate=True,
                    tooltip=_("When the playing song changes, "
                              "scroll to it in the song list"))
            vbox.pack_start(c, False, True, 0)
            frame = qltk.Frame(_("Behavior"), child=vbox)
            self.pack_start(frame, False, True, 0)

            # Columns
            vbox = Gtk.VBox(spacing=12)
            buttons = {}
            table = Gtk.Table.new(3, 3, True)

            for i, (k, t) in enumerate(self.PREDEFINED_TAGS):
                x, y = i % 3, i / 3
                buttons[k] = Gtk.CheckButton(label=t, use_underline=True)
                table.attach(buttons[k], x, x + 1, y, y + 1)
            vbox.pack_start(table, False, True, 0)

            # Other columns
            hbox = Gtk.HBox(spacing=6)
            l = Gtk.Label(label=_("_Others:"), use_underline=True)
            hbox.pack_start(l, False, True, 0)
            self.others = others = UndoEntry()
            others.set_sensitive(False)
            # Stock edit doesn't have ellipsis chars.
            edit_button = Gtk.Button(
                label=_(u"_Edit…"), use_underline=True)
            edit_button.connect("clicked", self.__config_cols, buttons)
            edit_button.set_tooltip_text(_("Add or remove additional column "
                                           "headers"))
            l.set_mnemonic_widget(edit_button)
            l.set_use_underline(True)
            hbox.pack_start(others, True, True, 0)
            vbox.pack_start(hbox, False, True, 0)
            b = Gtk.HButtonBox()
            b.set_layout(Gtk.ButtonBoxStyle.END)
            b.pack_start(edit_button, True, True, 0)
            vbox.pack_start(b, True, True, 0)

            frame = qltk.Frame(_("Visible Columns"), child=vbox)
            self.pack_start(frame, False, True, 0)

            # Column preferences
            tiv = Gtk.CheckButton(label=_("Title includes _version"),
                                  use_underline=True)
            aio = Gtk.CheckButton(label=_("Artist includes all _people"),
                                  use_underline=True)
            aip = Gtk.CheckButton(label=_("Album includes _disc subtitle"),
                                  use_underline=True)
            fip = Gtk.CheckButton(label=_("Filename includes _folder"),
                                  use_underline=True)
            self._toggle_data = [
                (tiv, "title", "~title~version"),
                (aip, "album", "~album~discsubtitle"),
                (fip, "~basename", "~filename"),
                (aio, "artist", "~people")
            ]

            self.__update(buttons, self._toggle_data, get_columns())

            t = Gtk.Table.new(2, 2, True)
            t.attach(tiv, 0, 1, 0, 1)
            t.attach(aip, 0, 1, 1, 2)
            t.attach(aio, 1, 2, 0, 1)
            t.attach(fip, 1, 2, 1, 2)
            frame = qltk.Frame(_("Column Preferences"), child=t)
            self.pack_start(frame, False, True, 0)

            # Apply button
            vbox = Gtk.VBox(spacing=12)
            apply = Button(_("_Apply"))
            apply.set_tooltip_text(_("Apply current configuration to song "
                                     "list, adding new columns to the end"))
            b = Gtk.HButtonBox()
            b.set_layout(Gtk.ButtonBoxStyle.END)
            b.pack_start(apply, True, True, 0)
            vbox.pack_start(b, True, True, 0)
            self.pack_start(vbox, True, True, 0)
            apply.connect('clicked', self.__apply, buttons)
            # Apply on destroy, else config gets mangled
            self.connect('destroy', self.__apply, buttons)

            for child in self.get_children():
                child.show_all()
开发者ID:MikeiLL,项目名称:quodlibet,代码行数:94,代码来源:prefs.py


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