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


Python HIGTable.modify_fg方法代码示例

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


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

示例1: BoxEditable

# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import modify_fg [as 别名]
class BoxEditable(HIGVBox):
    def __init__(self, section_name, profile, listoptions, notebook_parent, new=False):
        """
        A Box Editable contains a options of each tab
        @param section_name: section name <tab>
        @type section_name: str 
        @param profile: A class that view and modify xml file 
        @type profile: ProfileCore
        @param listoptions: The List of Options to update XML (I guess to confirm)
        @type listoptions: ListOptions
        @param notebook_parent: Notebook
        @type notebook_parent: Notebook or Subclass
        @param new: It's a new tab or not 
        @type new: bool
        """

        HIGVBox.__init__(self)
        self._coords = {}
        self._parent = notebook_parent
        self._last = None 
        #Profile Core do a manage at profile_editor.xml file 
        self._profilecore = None 

        self._profile = profile
        self._listoptions = listoptions
        self._table = HIGTable()
        self._section_name = section_name
        if not new :
            self._options = self._profile.get_section(section_name)
        self._table.set_border_width(3)
        c = self.get_colormap()
        color = c.alloc_color(0,0,0)   
        self._table.modify_fg(gtk.STATE_NORMAL,color )
        #self._fill_table()

        box_tmp = HIGVBox()
        box_tmp.pack_start(self._table, False, False)
        self._sw = HIGScrolledWindow()
        #self._sw.set_size_request(400,200)
        vp = gtk.Viewport()
        vp.add(box_tmp)
        vp.set_shadow_type(gtk.SHADOW_NONE)
        self._sw.add(vp)
        self.pack_start(self._sw, True, True)
        self._old_selected = None 
        self._x = 0
        self._y = 0 


        self.connect('button-press-event', self._bp)
    #Private API 
    def _bp(self, widget,event):
        pass

    def _fill_table(self):
        k = 0
        self._old_po = None
        for i in self._options:
            t = SpecialHBox()
            type = i.get_type()
            if type== 'option_check':

                name_option = i.get_option()
                hint = self._listoptions.get_hint(name_option)
                tmp_widget = OptionCheckIcon(i.get_label(),name_option,hint)
                t.pack_start(tmp_widget)
                arg_type = self._listoptions.get_arg_type(name_option)
                if arg_type!= '':
                    additional = type_mapping[arg_type]()
                    t.pack_start(additional)
                po = ProfileOption('option_check', i.get_label(),name_option, 
                                   arg_type,None)
                po.set_section(self.get_name())
                t.set_profileoption(po)


            elif type == 'option_list': 
                eventbox = gtk.EventBox()
                label = HIGEntryLabel(i.get_label())

                eventbox.add(label)
                tmp_widget = OptionList()
                list = []
                for j in i.get_option_list():
                    d = {}
                    d['name'] = j 
                    tmp_widget.append(d)
                    list.append(j)
                po = ProfileOption('option_list', i.get_label(),i.get_label(), 
                                   None,list)
                po.set_section(self.get_name())
                t.set_profileoption(po)
                t.pack_start(eventbox)		
                t.pack_start(tmp_widget)
                #t.drag_source_set(gtk.gdk.BUTTON1_MASK |
                                                    #gtk.gdk.BUTTON3_MASK,
                                                    #target, 
                                                    #gtk.gdk.ACTION_COPY |
                                                    #gtk.gdk.ACTION_MOVE)
                #t.connect('drag_data_get', self.source_drag_data_get)
#.........这里部分代码省略.........
开发者ID:aregee,项目名称:network-scanner,代码行数:103,代码来源:PageNotebook.py


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