Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 1094
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: Wed May 15 10:47:10 CEST 2024

Total time taken to generate the page: 0.01642 seconds