RE: Handling multiple selections in a Gtk::TreeView



I think they let you do stuff like this (I'm pretty sure I used them in Java
last year)

class someClass
{
private:
	int data;
public:
	someClass()
	{
		// takes a function as an argument
		doSomeStuff (
					// actually define a function here,
without naming it, I forget the syntax
					{
						++ data;
					}
				);
	}
};

That's about the gist of it I think.

Cheers!

Gaz


-----Original Message-----
From: gtkmm-list-bounces gnome org [mailto:gtkmm-list-bounces gnome org] On
Behalf Of Murray Cumming
Sent: 26 November 2004 09:35
To: Matthew Walton
Cc: gtkmm-list gnome org
Subject: Re: Handling multiple selections in a Gtk::TreeView


> When working with multiple selections, I find
> myself using get_selected_rows() much more frequently, to get a vector
> or list of selected rows, then iterating over that with a for loop. I
> might use selected_foreach more if C++ had anonymous functions.

Yes, I think that get_selected_rows() was added sometime after
selected_foreach(), because it was more convenient.

I don't understand the comment about C++ not having anonymous functions.
Maybe that's C# terminology.

> Really,
> which one to use depends on what you want to do - sometimes
> selected_foreach is more convenient.

Actually, I can't think of a case when it is right now. If you think of
one, let's document it.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



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