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


Python TreeItem.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:32,代码来源:settings_widget.py

示例2: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:31,代码来源:search_page.py

示例3: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:35,代码来源:lists.py

示例4: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:35,代码来源:music_list_item.py

示例5: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:27,代码来源:install_page.py

示例6: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:31,代码来源:install_page.py

示例7: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:32,代码来源:window_view.py

示例8: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:27,代码来源:uninstall_page.py

示例9: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:10,代码来源:home_page.py

示例10: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:10,代码来源:lyrics_search.py

示例11: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:11,代码来源:treeview.py

示例12: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:12,代码来源:add_item.py

示例13: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:12,代码来源:home_page.py

示例14: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
 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,代码行数:12,代码来源:radio_item.py

示例15: __init__

# 需要导入模块: from dtk.ui.treeview import TreeItem [as 别名]
# 或者: from dtk.ui.treeview.TreeItem import __init__ [as 别名]
    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,代码行数:13,代码来源:netease_music_browser.py


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