當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。