Logo Search packages:      
Sourcecode: samba-gtk version File versions  Download package

def sambagtk::pygwregedit::RegEditWindow::highlight_search_result (   self,
  key_iter,
  value_iter = None 
)
Select key_iter in the tree store. If value_iter is not none then value_iter will also be selected.

returns True if a key was successfully selected

Definition at line 1655 of file pygwregedit.py.

                                                                :
        """Select key_iter in the tree store. If value_iter is not none then value_iter will also be selected.
        
        returns True if a key was successfully selected"""
        if not self.connected():
            return
        if key_iter == None:
            return
        
        result = False
        
        self.ignore_selection_change = True
        model = self.keys_tree_view.get_model()
        try:
            self.keys_tree_view.expand_to_path(model.get_path(key_iter))
            self.keys_tree_view.set_cursor(model.get_path(key_iter))
            
            result = True
        except RuntimeError as re:
            #this could happen when we try to highlight a value that isn't in the tree
            print "Problem selecting key:", re.args[1]
        
        if value_iter != None:
            model = self.values_tree_view.get_model()
            try:
                path = model.get_path(value_iter) 
                self.values_tree_view.set_cursor(path)
                self.values_tree_view.expand_to_path(path)
            except RuntimeError as re:
                print "Problem selecting value:", re.args[1]
                
        self.ignore_selection_change = False
        return result
             

Generated by  Doxygen 1.6.0   Back to index