Various questions (gtk_text and thread)

I've created a log window with a GTK_TEXT widget, and 2 pipes to
normal output and error output of program launch via execvp.

For reading pipes I've created 2 threads which only consist in:

void log_text_normal_output() {
	char buff[100];
	int n;

	while(n=read(pipe2[0], buff, 100)) {
		gtk_text_insert(GTK_TEXT(log_text), NULL, NULL, NULL, buff, n);

It seems to work well but I would like to know if it cause some
of synchronisation with X11 for example or if Gtk manage with that well.

I also would like to know if I could limit the size/buffer of the
widget ? Or must I verify the size of it when I add something and delete
the oldest lines ? Could I know the number of lines or only number of
characters ?

So many questions...



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