Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Mouse Cursor: (3 Items)
   
Mouse Cursor  
I know that this has got to have a simple solution, but I have been unable to find it via google nor by searching the 
QNX websites.

How do you change the mouse cursor to a wait cursor (hour glass) ?

Thank you,
Kendall
RE: Mouse Cursor  
Hi Kendall,

you could use the PtWidget resource  Pt_ARG_CURSOR_TYPE :
   PtSetResource( widget, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_LONG_WAIT, 0 );

...or define your own cursor bitmap and use that; see example snippet below.

Cheers,
Thomas

<snip>
	struct bmpcursor_t {
		PhCursorDef_t	cdef;
		char				bmpbuf[ ( HEIGHT1 * BPL1 ) + ( HEIGHT2 * BPL2 ) - 1 ];
	}  bmpcursor;
	char  *bmp = bmpcursor.cdef.images;

	/* Setup first layer description */
	bmpcursor.cdef.size1.x   = WIDTH1;
	bmpcursor.cdef.size1.y   = HEIGHT1;
	bmpcursor.cdef.offset1.x = 0;
	bmpcursor.cdef.offset1.y = 0;
	bmpcursor.cdef.color1    = Pg_BLACK;
	bmpcursor.cdef.bytesperline1 = BPL1;

	/* Setup second layer description */
	bmpcursor.cdef.size2.x   = WIDTH2;
	bmpcursor.cdef.size2.y   = HEIGHT2;
	bmpcursor.cdef.offset2.x = 1;
	bmpcursor.cdef.offset2.y = 3;
	bmpcursor.cdef.color2    = Pg_WHITE;
	bmpcursor.cdef.bytesperline2 = BPL2;

	/* Initialize first layer bitmap */
	bmp = bmpcursor.cdef.images;
	bmp[ 0] = bmp[14] = 0xfe;
	bmp[ 1] = bmp[ 2] = bmp[12] = bmp[13] = 0x82;
	bmp[ 3] = bmp[ 4] = bmp[10] = bmp[11] = 0x44;
	bmp[ 5] = bmp[ 6] = bmp[ 8] = bmp[ 9] = 0x28;
	bmp[ 7] = 0x10;

	/* Initialize second layer bitmap */
	bmp = &bmp[15];
	bmp[ 0] = bmp[ 1] = bmp[ 9] = 0x70;
	bmp[ 2] = bmp[ 3] = bmp[ 5] = bmp[ 6] = bmp[ 7] = bmp[ 8] = 0x20;
	bmp[10] = 0xf8;

   PtSetResource( widget, Pt_ARG_BITMAP_CURSOR, &bmpcursor, sizeof bmpcursor );
   PtSetResource( widget, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0 );

</snip>

-----Original Message-----
From: Kendall Russell [mailto:community-noreply@qnx.com] 
Sent: Mittwoch, 11. Januar 2012 20:48
To: photon-graphics
Subject: Mouse Cursor


I know that this has got to have a simple solution, but I have been unable to find it via google nor by searching the 
QNX websites.

How do you change the mouse cursor to a wait cursor (hour glass) ?

Thank you,
Kendall



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post90910
Re: RE: Mouse Cursor  
Thank you very much.  That is exactly what I was looking for.