[gtkmm] progress bar headache



lo, ive got this code.....

**CODE***
int PSKWindow::md5deep()
{
	let_progress_go = true;
string s = "";
string cmd = "md5deep "; // prefix to location of md5deep operation
	if (m_entry_md5deep.get_text() == "")
	{
		m_entry_md5deep.set_text("~"); // if blank, do the home dir
	}
cmd = cmd + m_entry_md5deep.get_text();
cmd = cmd + " -r"; // recursive md5deep needed
char buf[BUFSIZ];
FILE *ptr;
if ((ptr = popen(cmd.c_str(), "r")) != NULL)
 {
   while (fgets(buf, BUFSIZ, ptr) != NULL)
    {
     s = s + buf;
//******* POINT A ********
    }
	
  m_TextBuffer->set_text(s); // fill the buffer with the output
  (void) pclose(ptr);
	
	let_progress_go = false;
  return 0;	
 }
}
***/CODE***

ive got a timeout event which makes a progress bar pulse() no problem at all, the idea is that let_progress_go (boolean) if true will allow the pulse command to happen, if not it will skip it (i used an if statement for that) -- still no trouble.

the problem is that the progress bar isnt started during this block of code, (when i set let_progress_g to true). and even if i put the pulse() call directly in the loop at point A it dosnt work.

the code it meant to call a system process, and fill a text buffer with the output. The other problem is that i'd like it to update the display as the output arrives not just at the end, but even if (again at point A) i put the set_text(s) call, it dosnt get updated. 

any ideas ?





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]