Jump to content

handling widgets created cpp side and lua side...


Charrua
 Share

Recommended Posts

Hi

I have some widgets created and handled on lua scripts

Now i need to create some widgets cpp side, and, as far as i know, there is one eventQueue so only one loop to peek events should exists, isn't it?

I do that loop, on a lua scrpt and i have exposed a class with tolua with only one method:

void ProcessEvent(Event event)

and when a piked event.source do not match any widget created by lua scripts then, the ProcessEvent in lua calls it's counterpart ProcessEvent method and pass the event to it.

When i push a button created by cpp, then the ProcessEvent method is invoked (that's ok and nice!) but the test

if (event.source == myCppCreatedButton) never gets true

i can and do use, event.id for example, so not all is wrong..

i guess that perhaps i'm missing something obvious, casting perhaps?

any idea?

by the way, any idea of doing the same thing better? or I did take a complicated solution being one easier?

thanks in advance

Juan

Paren el mundo!, me quiero bajar.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...