Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jul 1998 20:00:53 -0200
From:      Onur Toker <onur@kfupm.edu.sa>
To:        onur@kfupm.edu.sa, FREEBSD <freebsd-questions@FreeBSD.ORG>, SOLARIS-X86 <solaris-x86@webpro.eis.com>
Subject:   Multithreaded X11 applications
Message-ID:  <35A68F15.F26CCF74@kfupm.edu.sa>

next in thread | raw e-mail | index | archive | help
Hello,

	(1) I am looking for multithreaded X11 application examples (Using
Solaris threads,
and/or POSIX threads). Do you know any that may help me to understand
the current state of 
the art ? 

	(2) If you are an X11 expert, do you know any actual widget library
written 
completely in C++ ? All widget libraries that I know are written in C,
and I am just
curious to learn what direction the industry has adopted in the past
couple of years.


	To give you a better idea about what I would like to do, I include this
short program
fragment. This is basically what I want to do. WindowThread will be a
"self" managed 
GraphicsWindow widget. 


#include "Window.h"

#include <stdlib.h>
#include <unistd.h>
#include <iostream.h>

void main(int argc, char **argv)
{

	// Initialize the window thread 
	WindowThread W(10, 10, 100, 100, "TestWin");

	// Display the window on the screen 
	W.disp();

	// Initialize the window thread 
	WindowThread W2(210, 210, 100, 100, "TestWin");

	// Display the window on the screen 
	W2.disp();

	// Start the EVENT HANDLER LOOP as a thread
	W.start();

	// Start the EVENT HANDLER LOOP as a thread
	W2.start();

	// Plot something
	while(1) {

		int i;
		for (i = 0; i < 100; i++) {
			W.plot(rand() % 100, rand() % 100,rand() % 100, rand() % 100);
			W.flush();
			W2.plot(rand() % 100, rand() % 100,rand() % 100, rand() % 100);
			W2.flush();
		}

		W.clear(); 
		W2.clear(); 
	}

	thr_exit(NULL);
}

Thanks,

Onur

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35A68F15.F26CCF74>