Sorry for such a late response, but I just had a chance to come back to
the pygtk stuff.

Thank you for your help.  I tried using the following code and it
worked.  However, it is meant only delete one row at a time right?
(since get_slected() does not work in SELECTION_MULTIPLE mode)  If I
would like to delete multiple rows that are selected, do you have any
suggestions?  Again, using selection.selected_foreach produced errors.

> #Here is the function attached to the delete button:
> 
> def RemoveWatchVariables(button):
>   # delete each variable
>   def DeleteVar(model,path,iter,data=None):
>     model.remove(iter)
>   # get selection and iterate through
>   selection = watchvars_view.get_selection()
>   selection.selected_foreach(DeleteVar)  


On Tue, 2003-08-05 at 12:42, Grzegorz Adam Hankiewicz wrote:
> On 2003-08-05, Yang Zheng <[EMAIL PROTECTED]> wrote:
> > Can I not delete iterator like this?
> 
> Hmmm... can't say what you do wrong, but here's my deletion code,
> maybe it helps you:
> 
>    selection = self.list_view.get_selection()
>    model, iter, = selection.get_selected()
>    if iter:
>       path = model.get_path(iter)
>       model.remove(iter)
>       selection.select_path(path)
>       if not selection.path_is_selected(path):
>          row = path[0]-1
>          if row >= 0:
>             selection.select_path((row,))

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to