U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » Vector of Button
Re: Vector of Button [message #49510 is a reply to message #49509] Wed, 21 February 2018 15:32 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1277
Registered: August 2007
Senior Contributor
Hello Giorgio,

AFAIK you can't create a vector of buttons, since it is not moveable (not directly at least).
You can use Array instead. Their interfaces are almost identical.

Array<Button> vbo; <----

...

	vbo.Clear();
	for (size_t i=0; i<userslist.size(); i++) {
		auto& bt= vbo.Add()                    
                bt.SetLabel(userslist[i].FULLNAME);
	        Add(bt.VCenterPos(500-i*40).HCenterPos(300) );
	}



If you insist on using vector, you can use One<Button>: (See One<> in U++ docs.)

Vector<One<Button>> vbo;


Best regards,
Oblivion


 
Read Message
Read Message
Read Message
Previous Topic: Protect and Web
Next Topic: How to install on raspberry
Goto Forum:
  


Current Time: Fri Sep 11 20:27:44 GMT+2 2026

Total time taken to generate the page: 0.00552 seconds