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


Python Align.show_all方法代码示例

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


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

示例1: __init__

# 需要导入模块: from quodlibet.qltk.x import Align [as 别名]
# 或者: from quodlibet.qltk.x.Align import show_all [as 别名]
    def __init__(self, library, player, pattern_filename):
        super(SongInfo, self).__init__()
        self._pattern_filename = pattern_filename
        self.set_visible_window(False)
        align = Align(halign=Gtk.Align.START, valign=Gtk.Align.START)
        label = Gtk.Label()
        label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
        label.set_track_visited_links(False)
        label.set_selectable(True)
        align.add(label)
        label.set_alignment(0.0, 0.0)
        self._label = label
        connect_destroy(library, 'changed', self._on_library_changed, player)
        connect_destroy(player, 'song-started', self._on_song_started)

        label.connect('populate-popup', self._on_label_popup, player, library)
        self.connect('button-press-event', self._on_button_press_event,
                     player, library)

        try:
            with open(self._pattern_filename, "rb") as h:
                self._pattern = h.read().strip().decode("utf-8")
        except (EnvironmentError, UnicodeDecodeError):
            pass

        self._compiled = XMLFromMarkupPattern(self._pattern)
        align.show_all()
        self.add(align)
开发者ID:mistotebe,项目名称:quodlibet,代码行数:30,代码来源:info.py

示例2: pack

# 需要导入模块: from quodlibet.qltk.x import Align [as 别名]
# 或者: from quodlibet.qltk.x.Align import show_all [as 别名]
 def pack(self, songpane):
     self._main_box.pack1(self, True, False)
     self._rh_box = rhbox = Gtk.VBox(spacing=6)
     align = Align(self._sb_box, left=0, right=6, top=6)
     rhbox.pack_start(align, False, True, 0)
     rhbox.pack_start(songpane, True, True, 0)
     self._main_box.pack2(rhbox, True, False)
     rhbox.show()
     align.show_all()
     return self._main_box
开发者ID:mistotebe,项目名称:quodlibet,代码行数:12,代码来源:main.py

示例3: InternetRadio

# 需要导入模块: from quodlibet.qltk.x import Align [as 别名]
# 或者: from quodlibet.qltk.x.Align import show_all [as 别名]
class InternetRadio(Browser, util.InstanceTracker):

    __stations = None
    __fav_stations = None
    __librarian = None

    __filter = None

    name = _("Internet Radio")
    accelerated_name = _("_Internet Radio")
    keys = ["InternetRadio"]
    priority = 16
    uses_main_library = False
    headers = "title artist ~people grouping genre website ~format " "channel-mode".split()

    TYPE, ICON_NAME, KEY, NAME = range(4)
    TYPE_FILTER, TYPE_ALL, TYPE_FAV, TYPE_SEP, TYPE_NOCAT = range(5)
    STAR = ["artist", "title", "website", "genre", "comment"]

    @classmethod
    def _init(klass, library):
        klass.__librarian = library.librarian

        klass.__stations = SongLibrary("iradio-remote")
        klass.__stations.load(STATIONS_ALL)

        klass.__fav_stations = SongLibrary("iradio")
        klass.__fav_stations.load(STATIONS_FAV)

        klass.filters = GenreFilter()

    @classmethod
    def _destroy(klass):
        if klass.__stations.dirty:
            klass.__stations.save()
        klass.__stations.destroy()
        klass.__stations = None

        if klass.__fav_stations.dirty:
            klass.__fav_stations.save()
        klass.__fav_stations.destroy()
        klass.__fav_stations = None

        klass.__librarian = None

        klass.filters = None

    def __inhibit(self):
        self.view.get_selection().handler_block(self.__changed_sig)

    def __uninhibit(self):
        self.view.get_selection().handler_unblock(self.__changed_sig)

    def __destroy(self, *args):
        if not self.instances():
            self._destroy()

    def __init__(self, library):
        super(InternetRadio, self).__init__(spacing=12)
        self.set_orientation(Gtk.Orientation.VERTICAL)

        if not self.instances():
            self._init(library)
        self._register_instance()

        self.connect("destroy", self.__destroy)

        completion = LibraryTagCompletion(self.__stations)
        self.accelerators = Gtk.AccelGroup()
        self.__searchbar = search = SearchBarBox(completion=completion, accel_group=self.accelerators)
        search.connect("query-changed", self.__filter_changed)

        menu = Gtk.Menu()
        new_item = MenuItem(_(u"_New Station…"), Icons.LIST_ADD)
        new_item.connect("activate", self.__add)
        menu.append(new_item)
        update_item = MenuItem(_("_Update Stations"), Icons.VIEW_REFRESH)
        update_item.connect("activate", self.__update)
        menu.append(update_item)
        menu.show_all()

        button = MenuButton(SymbolicIconImage(Icons.EMBLEM_SYSTEM, Gtk.IconSize.MENU), arrow=True)
        button.set_menu(menu)

        def focus(widget, *args):
            qltk.get_top_parent(widget).songlist.grab_focus()

        search.connect("focus-out", focus)

        # treeview
        scrolled_window = ScrolledWindow()
        scrolled_window.show()
        scrolled_window.set_shadow_type(Gtk.ShadowType.IN)
        self.view = view = AllTreeView()
        view.show()
        view.set_headers_visible(False)
        scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        scrolled_window.add(view)
        model = Gtk.ListStore(int, str, str, str)

#.........这里部分代码省略.........
开发者ID:virtuald,项目名称:quodlibet,代码行数:103,代码来源:iradio.py

示例4: SoundcloudBrowser

# 需要导入模块: from quodlibet.qltk.x import Align [as 别名]
# 或者: from quodlibet.qltk.x.Align import show_all [as 别名]

#.........这里部分代码省略.........
        self.__auth_sig = self.api_client.connect('authenticated',
                                                  self.__on_authenticated)
        connect_destroy(self.library, 'changed', self.__changed)
        self.login_state = (State.LOGGED_IN if self.online
                            else State.LOGGED_OUT)
        self._create_searchbar(self.library)
        vbox = Gtk.VBox()
        vbox.pack_start(self._create_footer(), False, False, 6)
        vbox.pack_start(self._create_category_widget(), True, True, 0)
        vbox.pack_start(self.create_login_button(), False, False, 6)
        vbox.show()
        pane = qltk.ConfigRHPaned("browsers", "soundcloud_pos", 0.4)
        pane.show()
        pane.pack1(vbox, resize=False, shrink=False)
        self._songs_box = songs_box = Gtk.VBox(spacing=6)
        songs_box.pack_start(self._searchbox, False, True, 0)
        songs_box.show()
        pane.pack2(songs_box, resize=True, shrink=False)
        self.pack_start(pane, True, True, 0)
        self.show()

    @property
    def online(self):
        return self.api_client.online

    def _create_footer(self):
        hbox = Gtk.HBox()
        button = Gtk.Button(always_show_image=True,
                            relief=Gtk.ReliefStyle.NONE)
        button.connect('clicked', lambda _: website(SITE_URL))
        button.set_tooltip_text(_("Go to %s" % SITE_URL))
        button.add(self._logo_image)
        hbox.pack_start(button, True, True, 6)
        hbox.show_all()
        return hbox

    def _create_searchbar(self, library):
        completion = LibraryTagCompletion(library)
        self.accelerators = Gtk.AccelGroup()
        search = SearchBarBox(completion=completion,
                              validator=SoundcloudQuery.validator,
                              accel_group=self.accelerators,
                              timeout=3000)
        self.__searchbar = search
        search.connect('query-changed', self.__query_changed)

        def focus(widget, *args):
            qltk.get_top_parent(widget).songlist.grab_focus()
        search.connect('focus-out', focus)

        self._searchbox = Align(search, left=0, right=6, top=6)
        self._searchbox.show_all()

    def update_connect_button(self):
        but = self.login_button
        but.set_sensitive(False)
        tooltip, icon = self._login_state_data[self.login_state]
        but.set_tooltip_text(tooltip)
        child = but.get_child()
        if child:
            print_d("Removing old image...")
            but.remove(child)
        but.add(icon if icon else Gtk.Label(tooltip))

        but.get_child().show()
        but.set_sensitive(True)
开发者ID:zsau,项目名称:quodlibet,代码行数:70,代码来源:main.py

示例5: add_sidebar_to_layout

# 需要导入模块: from quodlibet.qltk.x import Align [as 别名]
# 或者: from quodlibet.qltk.x.Align import show_all [as 别名]
 def add_sidebar_to_layout(self, widget):
     print_d("Recreating sidebar")
     align = Align(widget, top=6, bottom=3)
     self.__paned.pack2(align, shrink=True)
     align.show_all()
开发者ID:zsau,项目名称:quodlibet,代码行数:7,代码来源:quodlibetwindow.py


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