[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1279.0. "Using 'standard' cursors and 'standard' colors" by STOAT::BARKER (Jeremy Barker - NAC Europe - REO2-G/J2) Tue Aug 15 1989 14:39

I need to do something which should be very straightforward....

I want to display the "wait" mouse cursor in some widgets.  I want to be
able to turn it on and off (using the normal cursor when it's off).

Surely there is some very simple way to do this???

jb

T.RTitleUserPersonal
Name
DateLines
1279.1how to put up the watch cursorPSW::WINALSKIMeetings are our most important productTue Aug 15 1989 16:0828
#include <decw$cursor.h>
#define cursor_font_name "decw$cursor"

Cursor wait_cursor;	/* cursor ID of wait cursor */
Font cursor_font;

/* Set up the wait cursor */

cursor_font = XLoadFont(our_display, cursor_font_name);
wait_cursor = XCreateGlyphCursor(our_display, cursor_font, cursor_font,
		decw$c_wait_cursor, decw$c_wait_cursor + 1,
		&our_cmap[1], &our_cmap[0]);
...

/* Put up the wait cursor */

XDefineCursor(our_display, w_main.win, wait_cursor);
XFlush(our_display);

...

/* Restore the normal cursor */

XUndefineCursor(our_display, w_main.win);


--PSW

1279.2Where do the colors come from???STOAT::BARKERJeremy Barker - NAC Europe - REO2-G/J2Wed Aug 16 1989 07:0813
Re: .1

Most helpful, a much lower noise level than in the manual; but where does
this (****) come from???  I have read the manual, but can't see how to get
the default cursor colors. 

>  wait_cursor = XCreateGlyphCursor(our_display, cursor_font, cursor_font,
>  		decw$c_wait_cursor, decw$c_wait_cursor + 1,
****>		&our_cmap[1], &our_cmap[0]);
>  ...

jb

1279.3RAB::DESAIJatin DesaiWed Aug 16 1989 11:0524
re: .-1

This is how we get it:



XColor colors[2];

colors [0] . pixel = WhitePixelOfScreen (screen);
colors [1] . pixel = BlackPixelOfScreen (screen);

/* Get the RGB values for these colors. */

XQueryColors (
              display,                              /* display   */
              DefaultColormapOfScreen (screen),     /* color map */
              colors,                               /* array of colors */
              2);                                   /* length of array */



- Jatin

1279.4my color map is getting full....STOAT::BARKERJeremy Barker - NAC Europe - REO2-G/J2Wed Aug 16 1989 13:5529
Re: .3

I think that that gets black and white.  I DO NOT want black and white.  

In the Session Manager setup there are several colors that you can define,
from Window...

	Screen Foreground
	Screen Background
	Window Foreground
	Window Background
	Window Highlight
	Window Border

and from Pointer...

	Pointer Foreground
	Pointer Background

Some other things - for example, the Wait cursor in the Session Manager
window and activated Toggle Buttons - seem to appear in another color. 

What I want is to be able to select these colors to avoid using up 
additional color map entries - I need them for other things (there are not 
many on a 4-plane system), and so that my display is consistent with the 
other displays on the screen.

jb

1279.5(Unless there's an easier way...)HANNAH::MESSENGERBob MessengerWed Aug 16 1989 14:1211
Re: .4

The session manager sets the sm.pointer_foreground and sm.pointer_background
resources to the pointer foreground and background colors.  You can read these
resources by calling XtDatabase (which means you'll have to call
XtCreateApplicationContext and XtDisplayInitialize) to obtain the resource
database set by the session manager and then calling XrmGetResource to read
the pointer resources that you're interested in.

				-- Bob

1279.6PSW::WINALSKIMeetings are our most important productWed Aug 16 1989 18:0713
RE: .2

In my example, our_cmap[0] is WhitePixelOfScreen and our_cmap[1] is
BlackPixelOfScreen.  Those parameters to XCreateCursor() are the foreground and
background pixel values.

The XUI Style Guide mandates the use of white background and black foreground
for the wait cursor.  Yes, a lot of applications, including some of the OOTBs,
use red-on-white.  They all picked up the same buggy code and are in violation
of the Style Guide.

--PSW

1279.7Come on, nowDECWIN::KLEINThu Aug 17 1989 13:289
>>for the wait cursor.  Yes, a lot of applications, including some of the OOTBs,
>>use red-on-white.  They all picked up the same buggy code and are in violation
>>of the Style Guide.

Give us a break.  The code we stole was originally written by Jake Vannoy,
who WAS Mr. Style Guide at the time!

-steve-

1279.8CASEE::LACROIXObject oriented dog food? No, sorryFri Aug 18 1989 10:4921
Re -2:

>use red-on-white.  They all picked up the same buggy code and are in violation
>of the Style Guide.

    All those 'Style Guide Violations' are a plain joke these days when
    folks are struggling to decide whether Motif will require one or two
    full time engineers to fix a single application. And officially, we are
    pleased by the OSF decision. Pfff...

Re -1:

>Give us a break.  The code we stole was originally written by Jake Vannoy,
>who WAS Mr. Style Guide at the time!

    So what? This wouldn't be the first time that the style guide is
    inconsistent with itself ;-) Sorry, couldn't resist. Apologies and all
    that.

    Denis.