2020-08-04 13:15:02 +08:00
|
|
|
#include "Window1.h"
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
USING_NS_AX;
|
2020-08-04 13:15:02 +08:00
|
|
|
|
|
|
|
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>();
|
2020-08-06 19:58:24 +08:00
|
|
|
item->setTitle(std::to_string(i));
|
2020-08-04 13:15:02 +08:00
|
|
|
item->setIcon("ui://Basics/r4");
|
|
|
|
}
|
|
|
|
}
|