Preventing concurrent processing?

[email protected] (Benjamin Smith)
Newsgroups php.gtk.general
Message-ID <[email protected]>
I'm having a problem with concurrent callbacks being generated. 

Say that there are two buttons on the screen, each of which take a few moments 
to process. If the user presses button A, and starts the process, and then 
presses button B before A's callback is done, then both callbacks 
are "running at the same time". 

This has resulted in some inconsistent states and program crashes. (EG: the 
callback for button A assumes that a certain object is defined, but since 
button B was pressed before A was done, that object is no longer there) 

Is this making sense? What's the best way to structure things to deal with 
this issue?

As a side note, I have a function called "UpdateScreen()" that I use within 
these intensive-processing functions as follows, so that the program "appears 
responsive"... is this the problem? 

Function UpdateScreen()
  {
  while (gtk::events_pending())
	gtk::main_iteration();
  }

-Ben

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.