RE: creating a vector of a vector of Gtk::ToggleButton
- From: "Erik Ohrnberger" <erik echohome org>
- To: <gtkmm-list gnome org>
- Subject: RE: creating a vector of a vector of Gtk::ToggleButton
- Date: Wed, 27 Oct 2004 23:45:26 -0400
Rob,
Strange thing. I noticed that a lot around Gtkmm. Private or
protected copy CTORs and / or assignment operators.
I'm sure that there must be a really good reason behind it, but I
don't know enough about the lower layers of the system to comment on it.
Perhaps one of the more knowledgeable users could enlighten us? Please?
Cheers,
Erik.
> -----Original Message-----
> From: gtkmm-list-bounces gnome org
> [mailto:gtkmm-list-bounces gnome org] On Behalf Of Rob Benton
> Sent: Thursday, October 28, 2004 12:27 AM
> To: gtkmm-list gnome org
> Subject: creating a vector of a vector of Gtk::ToggleButton
>
>
> Ok guys, I would best describe myself as a budding stl programmer. I
> have a situation where I need a matrix of toggle buttons but
> rather than
> use an array I'm using a vector of vectors. The error looks
> to me like
> the Gtk::ToggleButton's copy constructor is declared as
> private but that
> seems weird. Here's my code:
>
> CODE
> ==============================================================
> ==========
> typedef std::vector<Gtk::ToggleButton> chiprow;
>
> std::vector<chiprow> _chips;
>
> const int rows = 10;
> const int cols = 10;
>
> for (int i = 0; i < rows; ++i)
> {
> std::vector<Gtk::ToggleButton> cr;
>
> for (int j = 0; j < cols; ++j)
> {
> Gtk::ToggleButton tb;
> cr.push_back(tb);
> }
>
> _chips.push_back(cr);
> }
> }
> ==============================================================
> ==========
>
> I'm attaching the error separately b/c it's long. Am I on the right
> track or do I have the wrong approach? Comments appreciated.
>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]