I'm using System() to play a sound file and make a xmesage box. Problem is that my program will wait until I have pressed the ok button before continuing. This is a calendar/reminder program and if I have 2 alarmed events the 2nd will not be processed because the main prog is waiting for the first to end.
So is there any way around this? I tried adding '&' to the end of the System call string but didn't work.
Code:
void do_event_alarm(int ev)
{
string str="xmessage -center "+events[ev].summary+" 2>/dev/null";
string sound_str="aplay -q "+soundfile;
string start=events[ev].start;
if ( soundfile!="" ) system(sound_str.c_str());
if ( start!="" )
cout<<start.substr(6,2)<<"/"<<start.substr(4,2)<<"/"<<start.substr(0,4)<<endl;
cout<<events[ev].summary<<endl;
cout<<events[ev].description<<endl;
system(str.c_str());
}