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


Python TreeView.__init__方法代码示例

本文整理汇总了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()
开发者ID:quyf,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:29,代码来源:netease_music_view.py

示例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)
开发者ID:electricface,项目名称:deepin-music-player,代码行数:9,代码来源:download_view.py

示例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()
开发者ID:electricface,项目名称:deepin-music-player,代码行数:31,代码来源:song_view.py

示例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)
开发者ID:EightWarning,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:9,代码来源:netease_music_browser.py

示例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()
开发者ID:haskyLue,项目名称:deepin-music-player,代码行数:27,代码来源:radio_view.py

示例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
开发者ID:C2python,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:28,代码来源:netease_music_view.py

示例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
开发者ID:ggyismjxd,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:12,代码来源:netease_music_browser.py

示例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
开发者ID:yuanchenglu,项目名称:dmusic-plugin-baidumusic,代码行数:15,代码来源:music_view.py

示例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)
开发者ID:WilliamRen,项目名称:deepin-music-player,代码行数:8,代码来源:download_view.py

示例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)        
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:download_page.py


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