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   |
Oblivion
Messages: 1214 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.)
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
Goto Forum:
Current Time: Sat Jul 12 22:52:37 CEST 2025
Total time taken to generate the page: 0.05501 seconds
|