Logo Search packages:      
Sourcecode: accerciser version File versions

def accerciser::accessible_treeview::AccessibleTreeView::__init__ (   self,
  node 
)

Initialize the treeview. Build the proper columns.
Connect all of the proper signal handlers and at-spi event handlers.

@param node: The main application node.
@type node: L{Node}

Definition at line 367 of file accessible_treeview.py.

00367                           :
    '''
    Initialize the treeview. Build the proper columns.
    Connect all of the proper signal handlers and at-spi event handlers.
    
    @param node: The main application node.
    @type node: L{Node}
    '''
    gtk.TreeView.__init__(self)

    self.desktop = pyatspi.Registry.getDesktop(0)
    self.node = node
    self.node.update(self.desktop)
    self._changed_handler = self.node.connect('accessible_changed',
                                             self._onAccChanged)
    self.connect('row-activated', self._onRowActivated)

    self.model = AccessibleModel(self.desktop)
    self.set_model(self.model)
    crt = gtk.CellRendererText()
    crp = gtk.CellRendererPixbuf()
    tvc = gtk.TreeViewColumn(_('Name'))
    tvc.pack_start(crp, False)
    tvc.pack_start(crt, True)
    tvc.set_attributes(crp, pixbuf=COL_ICON)
    tvc.set_attributes(crt, text=COL_NAME)
    tvc.set_resizable(True)
    tvc.set_cell_data_func(crt, self._accCellDataFunc)
    tvc.set_cell_data_func(crp, self._accCellDataFunc)
    self.append_column(tvc)
    crt= gtk.CellRendererText()
    tvc = gtk.TreeViewColumn(_('Role'))
    tvc.pack_start(crt, True)
    tvc.set_attributes(crt, text=COL_ROLE)
    tvc.set_resizable(True)
    tvc.set_cell_data_func(crt, self._accCellDataFunc)
    self.append_column(tvc)
    crt = gtk.CellRendererText()
    tvc = gtk.TreeViewColumn(_('Children'))
    tvc.pack_start(crt, True)
    tvc.set_attributes(crt, text=COL_CHILDCOUNT)
    tvc.set_resizable(True)
    tvc.set_cell_data_func(crt, self._accCellDataFunc)
    self.append_column(tvc)

    self.model.connect('row-filled', self._onRowFilled)
    self.model.connect('start-populating', self._onStartPop)
    self.model.connect('end-populating', self._onEndPop)
    self._path_to_expand = None

    self._refreshTopLevel()

    selection = self.get_selection()
    selection.unselect_all()
    selection.connect('changed', self._onSelectionChanged)
    selection.set_select_function(self._selectFunc)
    self.connect('row-expanded', self._onExpanded)
    pyatspi.Registry.registerEventListener(self._accEventChildChanged, 
                                           'object:children-changed')

    self.action_group = gtk.ActionGroup('TreeActions')
    self.action_group.add_actions([
        ('RefreshAll', gtk.STOCK_REFRESH, None,
         None, 'Refresh all', self._refreshTopLevel),
        ('RefreshCurrent', gtk.STOCK_JUMP_TO, _('Refresh _Current'),
         None, 'Refresh selected node\'s children', self._refreshCurrentLevel)])  

    self.refresh_current_action = self.action_group.get_action('RefreshCurrent')
    self.refresh_current_action.set_sensitive(False)

  def _refreshTopLevel(self, action=None):


Generated by  Doxygen 1.6.0   Back to index