怎么用代码写一个 cocostudio Button出来???

我用代码写了一个Button出来,但是这样的要怎么开启它的点击事件呢?

UIButton* model = UIButton::create();
model->loadTextures("", “”, “”);
model->setTitleText(“123456789”);
model->setTitleFontSize(30);
model->setAnchorPoint(ccp(0.5,1));
model->setBright(true);
model->setTouchEnabled(true);
model->addTouchEventListener(this,toucheventselector(GameLogo::gameInfo));

试过
model->setBright(true);
model->setTouchEnabled(true);都开启不到~

还有,想请教下ListView容器的用法~

您好,请参考testcpp中的GUI示例,
button创建方法:

    // Create the button
    UIButton* button = UIButton::create();
    button->setTouchEnabled(true);
    button->loadTextures("cocosgui/animationbuttonnormal.png", "cocosgui/animationbuttonpressed.png", "");
    button->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
    button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent));
    m_pUiLayer->addWidget(button);

一个新的问题!
为什么加到ListView 里面就点击无效了呢?

UIListView* lv = UIListView::create();
UIButton* model = UIButton::create();
model->loadTextures("Image/di2.png", "Image/di2.png", "");
model->setTitleText("123456789");
model->setTitleFontSize(30);
model->setAnchorPoint(ccp(0.5,1));
//model->setBright(true);
model->setTouchEnabled(true);
model->addTouchEventListener(this,toucheventselector(GameLogo::gameInfo));
model->setTag(ENUM_INFO1);
//Logo->addWidget(model);

lv->setItemModel(model);


for (int i=0; i<20; i++)
{
    lv->pushBackDefaultItem();
}
lv->setItemsMargin(40);
lv->setGravity(LISTVIEW_GRAVITY_CENTER_HORIZONTAL);
lv->setSize(CCSizeMake(300, 300));
lv->setBackGroundColorType(LAYOUT_COLOR_SOLID);
lv->setBackGroundColor(ccRED);
lv->setPosition(ccp(0, 50));
Logo->addWidget(lv);

您好,关于Listview的使用参考UIListViewTest.cpp。listview分为模板item和自定义item。两者使用稍有不同。

解决了,谢谢楼主,监听事件用错了~不过,ListInfo(CCObject *pSender,ListViewEventType type),这个点击和松开都会进去,很不方便呀!
{

这个是事件分割,请根据type类型区分事件。感谢您对cocostudio的支持。