Logo Search packages:      
Sourcecode: audit version File versions  Download package

def rule_table::RuleTable::__init__ (   self,
  tree_view,
  up_button,
  down_button,
  insert_button,
  delete_button,
  edit_button 
)

Initialize a table.

The subclass must supply _column_titles.

Definition at line 39 of file rule_table.py.

                                            :
        '''Initialize a table.

        The subclass must supply _column_titles.

        '''
        self.up_button = up_button
        self.down_button = down_button
        self.delete_button = delete_button
        self.edit_button = edit_button
        self.store = gtk.ListStore(gobject.TYPE_PYOBJECT,
                                   *((gobject.TYPE_STRING,)
                                     * len(self._column_titles)))
        tree_view.set_model(self.store)
        column = 1
        for title in self._column_titles:
            c = gtk.TreeViewColumn(_(title), gtk.CellRendererText(),
                                   text = column)
            c.set_resizable(True)
            tree_view.append_column(c)
            column += 1
        tree_view.connect('row-activated', self.__edit_button_clicked)
        self.selection = tree_view.get_selection()
        util.connect_and_run(self.selection, 'changed',
                             self.__selection_changed)
        up_button.connect('clicked', self.__up_button_clicked)
        down_button.connect('clicked', self.__down_button_clicked)
        insert_button.connect('clicked', self.__insert_button_clicked)
        delete_button.connect('clicked', self.__delete_button_clicked)
        edit_button.connect('clicked', self.__edit_button_clicked)

    def load(self, rules):


Generated by  Doxygen 1.6.0   Back to index