Canvas update problem


I am developing a stripchart application where the data to be charted
comes from a server. There are two classes: one responsible for
communicating with the server and filling of the histograms and the other
one is for gui. The client class spins out a TThread that handles the
messages from the server using the following function:

static void* RecvFastEvents(void *arg)
if(arg == NULL)
return NULL;

//Get the pointer to the current client
OtrClient *clnt = (OtrClient*)arg;

//TTimer *timer = new TTimer();
//For testing

//Check if the socket is valid
if(clnt->fSocket == NULL)
  return NULL;

//Sit in a loop
while (1) {
  TMessage * msg = NULL;
  TObject * o = (TObject*)msg->ReadObject(msg->GetClass());
  //Process the collection
  //Increment the number of received events


Once the event is processed, i.e. histograms get filled, a signal is
generated to the gui class to update the canvas where the histograms were
drawn using the following method:

void OtrHistoDisplay::DoOtrFastViewUpdate() { //Raise modified flag for each pad pd_c1_1->Modified(); pd_c1_2->Modified(); pd_c1_3->Modified(); pd_c1_4->Modified(); //Now update the embedded canvas c1->Update(); }

The problem is that the call c1->Update() causes the entire application to

For the testing purposes i used to have a timer in my thread and
graphics worked quite well then.

Any suggestions will be greatly appreciated.

  • Vyacheslav