I'm using Gtkmm3 and I have a custom widget CustomWidget. I want to instantiate CutomWidget like so
1 2 3 4 5 6 7
string name = "Account" + std::to_string(m_notebook.get_n_pages() + 1);
//name will be generated eg Account1
CustomWidget *name = new CustomWidget;
//Which will be for example
//CustomWidget *Account2 = new CustomWidget;
m_notebook.append_page(*name);
//m_notebook.append_page(*Account2);
How can I make the notebook realize the string Account2 as a "member name". I don't know what its called that why I am calling it member name
string name = "Name" + n;
//name will be generated eg Name1
That's not going to do what you're thinking it does.
n is an int. You trying to append an int to a string.
n is going to be converted to a char with a value of binary 1, not ASCII "1".
CustomWidget *name = new CustomWidget;
That's not going to work either,. name is not a pointer and can;t be dereferenced.
AbstractionAnon I have fixed that in my github page, but still after proper coversion Im getting a t instead of Name+n as a string. with gtk thats the stage at which you define a variable as a pointer