How to remove selected items



Guys,

I have a question. Actually I have two, but I'll put the other in a separate thread.

In my application I have a TreeView showing a ListStore. The view is configured with SELECT_MULTIPLE, because I want the user to be able to select a number of rows and hit delete. When he does so, it should do the obvious thing and remove all the selected rows.

The question is, how do I do this? The API for handling multiple selections looks truly vile! Actually, I've already kind-of had to do it elsewhere, but in that case I was doing something it fitted rather better. Trying to use the multiple selection API to remove selected items from the list seems unnecessarily painful. And it seems like the sort of thing lots of applications might do, so I wondered if anyone had a nice neat trick for doing it in two lines :)

Thanks,
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]