mirror of https://github.com/axmolengine/axmol.git
22 lines
477 B
C++
22 lines
477 B
C++
#include "Window1.h"
|
|
|
|
USING_NS_AX;
|
|
|
|
void Window1::onInit()
|
|
{
|
|
setContentPane(UIPackage::createObject("Basics", "WindowA")->as<GComponent>());
|
|
center();
|
|
}
|
|
|
|
void Window1::onShown()
|
|
{
|
|
GList* list = _contentPane->getChild("n6")->as<GList>();
|
|
list->removeChildrenToPool();
|
|
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
GButton* item = list->addItemFromPool()->as<GButton>();
|
|
item->setTitle(std::to_string(i));
|
|
item->setIcon("ui://Basics/r4");
|
|
}
|
|
} |