Пример #1
0
static void meshscope(Window *win)
{
	Bool configured = FALSE;
	while (running) {
		while (XPending (meshscope_dpy)) {
			XEvent event;

			XNextEvent (meshscope_dpy, &event);
			switch (event.type) {
				case ConfigureNotify:
					glViewport (0, 0, event.xconfigure.width, event.xconfigure.height);
					configured = TRUE;
					break;
				case ButtonPress:
					mousepress(event);
					break;
				case ButtonRelease:
					mouserelease(event);
					break;
				case MotionNotify:
					mousemove(event);
					break;
				default:
					printf("event %x\n", event.type);
					break;
			}
		}
		drawMesh ();
		animate();
		dosleep (25000);
	}
}
Пример #2
0
void ImageLabel::mousePressEvent(QMouseEvent* e){
	if (e->button() == Qt::LeftButton){
		_mouseclick = true;
		startPos = e->pos();
		user_tl = startPos;
		points.push_back(startPos);
		emit mousepress(startPos);
	}
	QLabel::mousePressEvent(e);
}