Page 1 of 1

Button clicked evet

Posted: Tue May 31, 2011 13:27
by pista75
Hi.
My problem is that I loaded button from XML,but i can't treat in my c++ code.
What I can that treat clilck event?
Help me please,

Re: Button clicked evet

Posted: Tue May 31, 2011 13:56
by Kulik
Read documentation please...

Don't take this personally but if everyone asked these questions this forum would be overrun! SEARCH FIRST! And read the guidelines. One more thread like this and you are banned. Have a nice day :?

EDIT: For everyone thinking Kulik is too cruel, please see list of pista75's posts.
EDIT2: Downvoting admins sure is a good idea. :lol:

Re: Button clicked evet

Posted: Tue May 31, 2011 15:35
by pista75
Function if you want to run just 1 click.
Why a new class of such **it?

Re: Button clicked evet

Posted: Tue May 31, 2011 15:50
by CrazyEddie
There's no easy way to sugar coat this response, so I will not bother trying...

First, it's obvious that English in not your first language, but then it is not the first language of many on this forum, so I don't think that should be an excuse... However, it is definitely causing a lot of frustration, certainly to us, and no doubt to you, too.

Ok, here it comes :) Basically, in most of your posts we are unable to understand what you mean. We can't give meaningful answers because your posts lack clear questions, and also lack contextual information. I am a native English speaker, and this:
Function if you want to run just 1 click.
Why a new class of such **it?

is gibberish; it's meaningless nonsense. I have no idea how to answer this post, because it lacks any structure or form - it might as well be random words strung together.

My advice, for all your future posts, is to take some time to formulate your ideas clearly and post as much information as you can - as per the guidelines - we will try to help you if you make it easy for us. If you continue to make helping you difficult, we will not bother to try - you will be ignored.

I hope this makes the situation clear; it's not a personal attack, you're not the only one here with this problem.

CE.

Re: Button clicked evet

Posted: Tue May 31, 2011 15:56
by pista75
ok.
My code:

Code: Select all

 WindowManager& wmgr = WindowManager::getSingleton();
wmgr.getWindow("TextDemo/Sub")->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&kkk::add,this));


Errors:

Code: Select all

Error   7   error C2355: 'this' : can only be referenced inside non-static member functions
Error   8   error C2661: 'CEGUI::SubscriberSlot::SubscriberSlot' : no overloaded function takes 2 arguments
11   IntelliSense: 'this' may only be used inside a nonstatic member function
9   IntelliSense: no instance of constructor "CEGUI::SubscriberSlot::SubscriberSlot" matches the argument list
10   IntelliSense: function "kkk::add" (declared at line 72) is inaccessible


Sorry the last post...

Re: Button clicked evet

Posted: Tue May 31, 2011 16:01
by Kulik
OK this is definitely an improvement over the last post so kudos, keep it up.
The errors tell me that you are using this inside a static function or a free function. Please show how kkk::aaa is declared. Make sure you match the right function signature: bool mySlotFunction(const EventArgs& args)

PS: I don't need version info for this particular post but we require logs for all support requests for a reason, even if you think the log is useless, you should post it.

Re: Button clicked evet

Posted: Tue May 31, 2011 19:53
by belkacem
i don't know what is your problem exactly but
i think you should read this

http://cegui.org.uk/api_reference/classCEGUI_1_1Event.html#a0ef19f1fda5ea2eb9dac93d7f6bb6537