當前位置: 首頁>>代碼示例>>Python>>正文


Python treeview.TreeItem類代碼示例

本文整理匯總了Python中dtk.ui.treeview.TreeItem的典型用法代碼示例。如果您正苦於以下問題:Python TreeItem類的具體用法?Python TreeItem怎麽用?Python TreeItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TreeItem類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, connection, delete_cb, set_button_cb=None):
        TreeItem.__init__(self)
        #self.title = title
        self.connection = connection
        #self.click = click_cb
        self.delete_connection = delete_cb
        self.set_button = set_button_cb
        self.entry = None
        self.entry_buffer = EntryBuffer(connection.get_setting("connection").id)
        self.entry_buffer.set_property('cursor-visible', False)
        self.entry_buffer.connect("changed", self.entry_buffer_changed)
        self.entry_buffer.connect("insert-pos-changed", self.entry_buffer_changed)
        self.entry_buffer.connect("selection-pos-changed", self.entry_buffer_changed)
        self.child_items = []
        self.height = 30
        self.ENTRY_COLUMN = [1]
        self.is_double_click = False

        self.check_select = False
        self.is_hover = False
        self.delete_hover = False
        self.connection_active = False

        '''
        Pixbuf
        '''
        self.check_pixbuf_active = app_theme.get_pixbuf("network/check_box-1.png")
        self.delete_pixbuf_out = app_theme.get_pixbuf("network/delete-3.png")
        self.delete_pixbuf_prelight = app_theme.get_pixbuf("network/delete.png")
        self.delete_pixbuf_active = app_theme.get_pixbuf("network/delete-1.png")
開發者ID:electricface,項目名稱:deepin-system-settings,代碼行數:30,代碼來源:settings_widget.py

示例2: __init__

    def __init__(self, pkg_name, data_manager, keywords):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.data_manager = data_manager
        self.keywords = keywords
        self.icon_pixbuf = None

        (self.alias_name, self.short_desc, self.long_desc, star) = data_manager.get_pkg_search_info(self.pkg_name)
        info = self.data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.long_desc = info[3]

        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        self.highlight_string = get_match_context('\n'.join([self.short_desc, self.long_desc]), self.keywords)

        self.button_status = BUTTON_NORMAL

        ### TODO: is_installed status
        self.install_status = "uninstalled"
        self.desktops = []
        self.data_manager.get_pkg_installed(self.pkg_name, self.handle_pkg_status)
開發者ID:martyr-deepin,項目名稱:deepin-store,代碼行數:29,代碼來源:search_page.py

示例3: __init__

    def __init__(self,
                 name,
                 ap_list,
                 setting_page,
                 slide_to_setting_page_cb,
                 send_to_crumb,
                 check_state=2,
                 font_size=DEFAULT_FONT_SIZE):

        TreeItem.__init__(self)

        self.name = name
        self.ap_list = ap_list
        self.setting = setting_page
        self.slide_to_setting = slide_to_setting_page_cb
        self.send_to_crumb = send_to_crumb
        self.font_size = font_size
        self.check_width = self.get_check_width()
        self.essid_width = self.get_essid_width(self.name)
        self.jumpto_width = self.get_jumpto_width()
        self.network_state = check_state

        self.is_last = True
        self.position = 0

        '''
        Pixbufs
        '''
        self.border_color = border_normal_color
        self.bg_color = bg_normal_color
        self.loading_pixbuf = app_theme.get_pixbuf("network/loading.png")
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
開發者ID:electricface,項目名稱:deepin-system-settings,代碼行數:33,代碼來源:lists.py

示例4: __init__

    def __init__(self, data_or_title, list_type, has_separator=False):
        TreeItem.__init__(self)
        
        self.column_index = 0
        self.side_padding = 5
        self.is_highlight = False        
        self.padding_y = 0
        self.padding_x = 8
        self.list_type = list_type        
        
        if isinstance(data_or_title, basestring):
            self.title = data_or_title
            self.data = dict()
        else:    
            self.title = data_or_title.get("title", "")
            self.data = data_or_title
            
        self.data = data_or_title
        self.has_separator = has_separator        
        self.separator_height = 4
        self.item_width = CATEGROYLIST_WIDTH
        self.item_height = 26 + self.separator_height if has_separator else 26
        self.init_pixbufs()

        self.song_view = MusicView(view_type=list_type, data=self.data)
        # self.song_view.connect("begin-add-items", self.on_songview_begin_add_items)
        # self.song_view.connect("empty-items", self.on_songview_empty_items)
        self.song_view.set_size_request(PLAYLIST_WIDTH, -1)
        
        event_manager.connect("login-success", self.on_event_login_success)
        
        self.login_box = LoginBox(lambda w: event_manager.emit("login-dialog-run"))
        self.main_box = gtk.VBox()
開發者ID:WilliamRen,項目名稱:dmusic-plugin-baidumusic,代碼行數:33,代碼來源:music_list_item.py

示例5: __init__

 def __init__(self, pkg_name, pkg_version, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.pkg_name = pkg_name
     self.pkg_version = pkg_version
     self.data_manager = data_manager
     self.icon_pixbuf = None
     
     (self.short_desc, star, self.alias_name) = data_manager.get_item_pkg_info(self.pkg_name)
     self.star_level = get_star_level(star)
     self.star_buffer = DscStarBuffer(pkg_name)
     
     self.grade_star = 0
     
     self.status = self.STATUS_READY_DOWNLOAD
     self.status_text = _("Analyzing dependencies")
     self.progress_buffer = ProgressBuffer()
     
     button_pixbuf = app_theme.get_pixbuf("button/start_normal.png").get_pixbuf()
     (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
     self.button_status = BUTTON_NORMAL
     
     self.is_have_desktop_file = False
開發者ID:PeterDaveHello,項目名稱:deepin-software-center,代碼行數:25,代碼來源:install_page.py

示例6: __init__

    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None

        info = self.data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        self.status = self.STATUS_READY_DOWNLOAD
        self.status_text = _("Dependencies analyzing")
        self.progress_buffer = ProgressBuffer()

        button_pixbuf = app_theme.get_pixbuf("button/start_normal.png").get_pixbuf()
        (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL

        ### TODO: is_installed status
        self.install_status = json.dumps([])
        self.desktops = []
開發者ID:kissthink,項目名稱:deepin-store,代碼行數:29,代碼來源:install_page.py

示例7: __init__

    def __init__(self, title, is_parent=False, is_in_blacklist=False):
        '''
        init docs
        '''
        TreeItem.__init__(self)

        self.title = title

        self.item_height = 26
        self.item_width = 200

        self.draw_padding_x = 10
        self.draw_padding_y = 10

        self.column_index = 0

        self.is_hover = False
        self.is_select = False
        self.is_highlight = False

        self.is_parent = is_parent
        self.is_in_blacklist = is_in_blacklist

        if is_parent:
            self.row_index = 0
        else:
            self.row_index = 1


        self.child_offset = 10
開發者ID:electricface,項目名稱:deepin-notifications,代碼行數:30,代碼來源:window_view.py

示例8: __init__

    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None
        
        info = data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0
        
        button_pixbuf = app_theme.get_pixbuf("button/uninstall_normal.png").get_pixbuf()
        (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL
        
        self.status = self.STATUS_NORMAL
        self.status_text = ""
        self.progress_buffer = ProgressBuffer()
開發者ID:electricface,項目名稱:deepin-software-center,代碼行數:25,代碼來源:uninstall_page.py

示例9: __init__

 def __init__(self, index, first_category_name, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.index = index
     self.first_category_name = first_category_name
     self.data_manager = data_manager
開發者ID:electricface,項目名稱:deepin-software-center,代碼行數:8,代碼來源:home_page.py

示例10: __init__

 def __init__(self, lrc_list):
     TreeItem.__init__(self)
     
     self.update(lrc_list)
     
     self.is_highlight = False
     self.column_index = 0
     self.default_height = 26
開發者ID:electricface,項目名稱:deepin-music-player,代碼行數:8,代碼來源:lyrics_search.py

示例11: __init__

    def __init__(self, session_view, item):

        TreeItem.__init__(self)
        self.session_view = session_view
        self.item = item
        self.is_double_click = False
        self.check_buffer = CheckButtonBuffer(self.item.is_autostart(), CHECK_WIDTH/2 - 16, 3)
        
        self.padding_x = 10
開發者ID:electricface,項目名稱:deepin-system-settings,代碼行數:9,代碼來源:treeview.py

示例12: __init__

 def __init__(self, title, column_index=0):
     TreeItem.__init__(self)
     self.column_index = column_index
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 160
     self.child_items = []
     self.title_padding_x = 10
     self.widget = None
開發者ID:electricface,項目名稱:deepin-system-settings,代碼行數:10,代碼來源:add_item.py

示例13: __init__

 def __init__(self, first_category_name, second_category_name, pkg_names, data_manager, desktop_infos):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.first_category_name = first_category_name
     self.second_category_name = second_category_name
     self.all_pkg_names = pkg_names
     self.data_manager = data_manager
     self.all_desktop_infos = desktop_infos
開發者ID:PeterDaveHello,項目名稱:deepin-software-center,代碼行數:10,代碼來源:home_page.py

示例14: __init__

 def __init__(self, title, icon_name, callback=None):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 121
     self.padding_x = 10
     self.press_callback = callback
     self.init_pixbufs(icon_name)
開發者ID:WilliamRen,項目名稱:deepin-music-player,代碼行數:10,代碼來源:radio_item.py

示例15: __init__

    def __init__(self, song):

        TreeItem.__init__(self)

        self.update(song)
        self.height = 26

        self.is_highlight = False
        self.column_index = 0

        self.default_height = 26
開發者ID:ggyismjxd,項目名稱:dmusic-plugin-NeteaseCloudMusic,代碼行數:11,代碼來源:netease_music_browser.py


注:本文中的dtk.ui.treeview.TreeItem類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。