Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofEvent const problem

$
0
0

@Gallo wrote:

hello,

i created an event like

ofEvent<bool> timerEnded;

then when i notify the event

 ofNotifyEvent(timerEnded, true);

this is throwing an error.

I found this thread

i then changed to

 ofEvent<const bool> timerEnded;

but something is going wrong with the listener declaration (which seems expected in the above thread).
This i don't know how to fix it.

ofAddListener(this->timerEnded, this, &Timer::onTimerEnd);

so for now i am stuck using

bool isTimerEnded = true;
ofNotifyEvent(timerEnded, isTimerEnded);

which is fine for now, but if there is a proper solution, i would find it cleaner.

thanks

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles