本文整理汇总了Python中foobnix.helpers.menu.Popup.append方法的典型用法代码示例。如果您正苦于以下问题:Python Popup.append方法的具体用法?Python Popup.append怎么用?Python Popup.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类foobnix.helpers.menu.Popup
的用法示例。
在下文中一共展示了Popup.append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PlaylistTreeControl
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import append [as 别名]
class PlaylistTreeControl(CommonTreeControl):
def __init__(self, controls):
CommonTreeControl.__init__(self, controls)
self.header_pressed = False
self.menu = Popup()
self.tree_menu = Popup()
self.full_name = ""
self.label = Gtk.Label()
self.set_headers_visible(True)
self.set_headers_clickable(True)
self.set_reorderable(True)
"""Column icon"""
self.icon_col = Gtk.TreeViewColumn(None, Gtk.CellRendererPixbuf(), icon_name=self.play_icon[0])
self.icon_col.key = "*"
self.icon_col.label = Gtk.Label("*")
self._append_column(self.icon_col)
"""track number"""
self.trkn_col = Gtk.TreeViewColumn(None, Gtk.CellRendererText(), text=self.tracknumber[0])
self.trkn_col.key = "N"
#self.trkn_col.set_clickable(True)
self.trkn_col.label = Gtk.Label("№")
self.trkn_col.item = Gtk.CheckMenuItem(_("Number"))
self._append_column(self.trkn_col)
"""column composer"""
self.comp_col = Gtk.TreeViewColumn(None, self.ellipsize_render, text=self.composer[0])
self.comp_col.key = "Composer"
self.comp_col.label = Gtk.Label(_("Composer"))
self.comp_col.item = Gtk.CheckMenuItem(_("Composer"))
self._append_column(self.comp_col)
"""column artist title"""
self.description_col = Gtk.TreeViewColumn(None, self.ellipsize_render, text=self.text[0], font=self.font[0])
self.description_col.key = "Track"
self.description_col.label = Gtk.Label(_("Track"))
self.description_col.item = Gtk.CheckMenuItem(_("Track"))
self._append_column(self.description_col)
"""column artist"""
self.artist_col = Gtk.TreeViewColumn(None, self.ellipsize_render, text=self.artist[0])
self.artist_col.key = "Artist"
self.artist_col.label = Gtk.Label(_("Artist"))
self.artist_col.item = Gtk.CheckMenuItem(_("Artist"))
self._append_column(self.artist_col)
"""column title"""
self.title_col = Gtk.TreeViewColumn(None, self.ellipsize_render, text=self.title[0])
self.title_col.key = "Title"
self.title_col.label = Gtk.Label(_("Title"))
self.title_col.item = Gtk.CheckMenuItem(_("Title"))
self._append_column(self.title_col)
"""column year"""
self.year_col = Gtk.TreeViewColumn(None, Gtk.CellRendererText(), text=self.year[0])
self.year_col.key = "Year"
self.year_col.set_sizing(Gtk.TREE_VIEW_COLUMN_AUTOSIZE)
self.year_col.set_resizable(True)
self.year_col.label = Gtk.Label(_("Year"))
self.year_col.item = Gtk.CheckMenuItem(_("Year"))
self._append_column(self.year_col)
"""column album"""
self.album_col = Gtk.TreeViewColumn(None, self.ellipsize_render, text=self.album[0])
self.album_col.key = "Album"
if self.album_col.key not in FC().columns:
FC().columns[self.album_col.key] = [False, 7, 90]
self.album_col.label = Gtk.Label(_("Album"))
self.album_col.item = Gtk.CheckMenuItem(_("Album"))
self._append_column(self.album_col)
"""column time"""
self.time_col = Gtk.TreeViewColumn(None, Gtk.CellRendererText(), text=self.time[0])
self.time_col.key = "Time"
self.time_col.label = Gtk.Label(_("Time"))
self.time_col.item = Gtk.CheckMenuItem(_("Time"))
self._append_column(self.time_col)
self.configure_send_drag()
self.configure_recive_drag()
self.set_playlist_plain()
self.connect("button-release-event", self.on_button_press)
self.on_load()
self.connect("columns-changed", self.on_columns_changed)
def set_playlist_tree(self):
self.rebuild_as_tree()
def set_playlist_plain(self):
self.rebuild_as_plain()
#.........这里部分代码省略.........
示例2: PlaylistTreeControl
# 需要导入模块: from foobnix.helpers.menu import Popup [as 别名]
# 或者: from foobnix.helpers.menu.Popup import append [as 别名]
class PlaylistTreeControl(CommonTreeControl):
def __init__(self, controls):
CommonTreeControl.__init__(self, controls)
self.set_headers_visible(True)
self.set_headers_clickable(True)
self.set_reorderable(True)
self.menu = Popup()
"""Column icon"""
self.icon_col = gtk.TreeViewColumn(None, gtk.CellRendererPixbuf(), stock_id=self.play_icon[0])
self.icon_col.key = "*"
self.icon_col.set_fixed_width(5)
self.icon_col.set_min_width(5)
self.icon_col.label = gtk.Label("*")
self._append_column(self.icon_col)
"""track number"""
self.trkn_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.tracknumber[0])
self.trkn_col.key = "№"
self.trkn_col.set_clickable(True)
self.trkn_col.label = gtk.Label("№")
self.trkn_col.label.show()
self.trkn_col.item = gtk.CheckMenuItem(_("Number"))
self.trkn_col.set_widget(self.trkn_col.label)
self._append_column(self.trkn_col)
"""column composer"""
self.comp_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.composer[0])
self.comp_col.key = "Composer"
self.comp_col.set_resizable(True)
self.comp_col.label = gtk.Label(_("Composer"))
self.comp_col.item = gtk.CheckMenuItem(_("Composer"))
self._append_column(self.comp_col)
"""column artist title"""
self.description_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.text[0], font=self.font[0])
self.description_col.key = "Track"
self.description_col.set_resizable(True)
self.description_col.label = gtk.Label(_("Track"))
self.description_col.item = gtk.CheckMenuItem(_("Track"))
self._append_column(self.description_col)
"""column artist"""
self.artist_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.artist[0])
self.artist_col.key = "Artist"
self.artist_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
self.artist_col.set_resizable(True)
self.artist_col.label = gtk.Label(_("Artist"))
self.artist_col.item = gtk.CheckMenuItem(_("Artist"))
self._append_column(self.artist_col)
"""column title"""
self.title_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.title[0])
self.title_col.key = "Title"
self.title_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
self.title_col.set_resizable(True)
self.title_col.label = gtk.Label(_("Title"))
self.title_col.item = gtk.CheckMenuItem(_("Title"))
self._append_column(self.title_col)
"""column album"""
self.album_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.album[0])
self.album_col.key = "Album"
if not FC().columns.has_key(self.album_col.key):
FC().columns[self.album_col.key] = [False, 7, 90]
self.album_col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
self.album_col.set_resizable(True)
self.album_col.label = gtk.Label(_("Album"))
self.album_col.item = gtk.CheckMenuItem(_("Album"))
self._append_column(self.album_col)
"""column time"""
self.time_col = gtk.TreeViewColumn(None, gtk.CellRendererText(), text=self.time[0])
self.time_col.key = "Time"
self.time_col.label = gtk.Label(_("Time"))
self.time_col.item = gtk.CheckMenuItem(_("Time"))
self._append_column(self.time_col)
self.configure_send_drag()
self.configure_recive_drag()
self.set_playlist_plain()
self.connect("button-release-event", self.on_button_press)
self.on_load()
self.connect("columns-changed", self.on_columns_changed)
def set_playlist_tree(self):
self.rebuild_as_tree()
def set_playlist_plain(self):
self.rebuild_as_plain()
#.........这里部分代码省略.........