nanogui: more getting to grips with Nano-X: weirdness with events.


Previous by date: 16 Jun 2000 09:16:16 -0000 Re: Problems with chinese font implementation, 曾昭明
Next by date: 16 Jun 2000 09:16:16 -0000 Re: MWin and apps, rguseyno.cms.vinnica.ua
Previous in thread:
Next in thread: 16 Jun 2000 09:16:16 -0000 Re: more getting to grips with Nano-X: weirdness with events., Alex Holden

Subject: more getting to grips with Nano-X: weirdness with events.
From: Simon Wood ####@####.####
Date: 16 Jun 2000 09:16:16 -0000
Message-Id: <44632C76B97BD211AF6B00805FADCAB202D7364A@exchange.saltaire.pace.co.uk>

More questions/comments I'm afraid... please bare with me, I'm sure I'm not
just being dumb.

Knocked up a simple demo to look at events under Nano-x, looks for 2 types
(mouse enter/exit and button up/down).

I'm seeing that the holding the button down on the mouse is blocking the
enter/exit events, and the subsequent button up event is being issued even
when cursor is outside of the window boundary. Button down events do not
occur outside window boundary.

Is this normal behaviour, and should it be??

Code snippets
...
	w1 = GrNewWindow(GR_ROOT_WINDOW_ID, 10, 10, 60, 60, 2, BLACK,
WHITE);
...
	GrSelectEvents(w1, GR_EVENT_MASK_EXPOSURE |
		GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_BUTTON_UP |
		GR_EVENT_MASK_MOUSE_ENTER| GR_EVENT_MASK_MOUSE_EXIT |
		GR_EVENT_MASK_KEY_DOWN);
...
static void
handleevent(GR_EVENT *ep)
{
	switch(ep->type) {
		case GR_EVENT_TYPE_BUTTON_DOWN:
			GrSetGCForeground(gc1, BLUE);
			GrFillRect(w1, gc1, 10, 10, 40, 40);
			fprintf(stderr, "Button Down (%d, %d)\n",
ep->button.x, ep->button.y);
			break;
		case GR_EVENT_TYPE_BUTTON_UP:
			GrSetGCForeground(gc1, RED);
			GrFillRect(w1, gc1, 10, 10, 40, 40);
			fprintf(stderr, "Button Up (%d, %d)\n",
ep->button.x, ep->button.y);
			break;
		case GR_EVENT_TYPE_MOUSE_ENTER:
			GrSetBorderColor(w1, GREEN);
			break;
		case GR_EVENT_TYPE_MOUSE_EXIT:
			GrSetBorderColor(w1, WHITE);
			break;
	}
}


Simon Wood
(RRPITA)


Previous by date: 16 Jun 2000 09:16:16 -0000 Re: Problems with chinese font implementation, 曾昭明
Next by date: 16 Jun 2000 09:16:16 -0000 Re: MWin and apps, rguseyno.cms.vinnica.ua
Previous in thread:
Next in thread: 16 Jun 2000 09:16:16 -0000 Re: more getting to grips with Nano-X: weirdness with events., Alex Holden


Powered by ezmlm-browse 0.20.