本文整理汇总了Python中dtk.ui.treeview.TreeView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TreeView.__init__方法的具体用法?Python TreeView.__init__怎么用?Python TreeView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.treeview.TreeView
的用法示例。
在下文中一共展示了TreeView.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self, data=None, view_type=1):
TreeView.__init__(self, enable_drag_drop=False,
enable_multiple_select=True)
# view_type 为list类型
self.connect("double-click-item", self.on_music_view_double_click)
self.connect("press-return", self.on_music_view_press_return)
self.connect("right-press-items", self.on_music_view_right_press_items)
#self.connect("delete-select-items",
#self.on_music_view_delete_select_items)
self.db_file = get_cache_file("neteasecloudmusic/neteasecloudmusic.db")
self.view_type = view_type
self.view_data = data
self.request_thread_id = 0
self.collect_thread_id = 0
self.onlinelist_thread_id = 0
self.collect_page = 0
#self.load_online_playlists()
#if self.view_type == self.DEFAULT_TYPE:
#self.load()
#elif self.view_type == self.COLLECT_TYPE:
#self.load_collect_songs()
#elif self.view_type == self.PLAYLIST_TYPE:
self.load_onlinelist_songs()
示例2: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False, enable_multiple_select=False)
# Player.connect("instant-new-song", self.on_new_song)
Dispatcher.connect("download-songs", self.on_dispatcher_download_songs)
self.set_expand_column(1)
示例3: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False, enable_multiple_select=True)
targets = [("text/deepin-songs", gtk.TARGET_SAME_APP, 1), ("text/uri-list", 0, 2), ("text/plain", 0, 3)]
self.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP,
targets, gtk.gdk.ACTION_COPY)
self.pl = None
self.add_song_cache = []
sort_key = ["file", "album", "genre", "#track", "artist", "title", "#playcount", "#added"]
self.sort_reverse = {key : False for key in sort_key }
self.connect_after("drag-data-received", self.on_drag_data_received)
self.connect("double-click-item", self.double_click_item_cb)
self.connect("button-press-event", self.button_press_cb)
self.connect("delete-select-items", self.try_emit_empty_signal)
self.connect("motion-notify-item", self.on_motion_notify_item)
self.connect("press-return", self.on_press_return)
self.draw_area.connect("leave-notify-event", self.on_leave_notify_event)
self.set_hide_columns([1])
self.set_expand_column(None)
MediaDB.connect("removed", self.__remove_songs)
MediaDB.connect("simple-changed", self.__songs_changed)
self.song_notify = SongNotify()
self.notify_timeout_id = None
self.notify_timeout = 400 # ms
self.delay_notify_item = None
self.notify_offset_x = 5
self.invaild_items = set()
示例4: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self, enable_multiple_select=True):
TreeView.__init__(self, enable_drag_drop=False,
enable_multiple_select=enable_multiple_select)
#self.connect("double-click-item", self.on_music_view_double_click)
#self.connect("press-return", self.on_music_view_press_return)
self.connect("right-press-items", self.right_press_items)
示例5: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TreeView.__init__(self, *args, **kwargs)
targets = [
("text/deepin-radios", gtk.TARGET_SAME_APP, 1),
]
self.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP,
targets, gtk.gdk.ACTION_COPY)
self.connect_after("drag-data-received", self.on_drag_data_received)
self.connect("double-click-item", self.on_double_click_item)
self.connect("button-press-event", self.on_button_press_event)
self.connect("delete-select-items", self.try_emit_empty_signal)
self.connect("right-press-items", self.on_right_press_items)
Dispatcher.connect("play-radio", self.on_dispatcher_play_radio)
Player.connect("play-end", self.on_play_end)
self.lock = threading.Lock()
self.current_index = 0
self.playlist = []
self.limit_number = 25
self.preview_db_file = get_config_file("preview_radios.db")
self.status_db_file = get_cache_file("musicfm/status.db")
self.load_status()
示例6: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self, data=None, view_type=1):
TreeView.__init__(self, enable_drag_drop=False,
enable_multiple_select=True)
# view_type 为list类型
self.connect("double-click-item", self.on_music_view_double_click)
self.connect("press-return", self.on_music_view_press_return)
self.connect("right-press-items", self.on_music_view_right_press_items)
#self.connect("delete-select-items",
#self.on_music_view_delete_select_items)
self.db_file = get_cache_file("neteasecloudmusic/neteasecloudmusic.db")
self.view_type = view_type
self.view_data = data
self.request_thread_id = 0
self.collect_thread_id = 0
self.onlinelist_thread_id = 0
self.collect_page = 0
if self.view_type not in [self.PLAYING_LIST_TYPE, self.LOGIN_LIST_TYPE,
self.PERSONAL_FM_ITEM]:
self.load_onlinelist_songs()
if self.view_type == self.PERSONAL_FM_ITEM:
self.enable_multiple_select=False
示例7: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False,
enable_multiple_select=True)
# view_type 为list类型
self.connect("double-click-item", self.on_music_view_double_click)
self.connect("press-return", self.on_music_view_press_return)
self.connect("right-press-items", self.on_music_view_right_press_items)
self.onlinelist_thread_id = 0
示例8: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False, enable_multiple_select=True)
self.connect("double-click-item", self.on_music_view_double_click)
self.connect("press-return", self.on_music_view_press_return)
event_manager.connect("add-songs", self.on_event_add_songs)
event_manager.connect("play-songs", self.on_event_play_songs)
self.db_file = get_config_file("baidumusic.db")
self.load()
self.request_thread_id = 0
示例9: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False, enable_multiple_select=False)
Player.connect("instant-new-song", self.on_new_song)
self.set_expand_column(1)
示例10: __init__
# 需要导入模块: from dtk.ui.treeview import TreeView [as 别名]
# 或者: from dtk.ui.treeview.TreeView import __init__ [as 别名]
def __init__(self):
TreeView.__init__(self, enable_drag_drop=False, enable_multiple_select=False)
event_manager.add_callback("download-images", self.on_download_images)