[comp.windows.x] Retaining what is under a popup menu?

spencer@heinlein.osc.edu (Stephen N. Spencer) (10/28/89)

[Please reply to one of the email addresses listed at the end of this message!]
                 [spencer@heinlein.osc.edu WILL NOT WORK.]

Background:  Sun3/60, Sun OS4.0, XV11R3, HP widgets.
I have a question regarding popped-up resources and retaining what's under-
neath these resources.  An example may help to illustrate my problem:

I have an interactive program called 'foo'.  In it I use, among other things,
(a) popup menus, and (b) home-brewed 'user-interface utilities', for example,
a popup dialog box which requests a string from the user to serve as a file
name.

The popup menus I'm using are straight from the HP widget collection.
The home-brewed dialog uses the "transientShellWidgetClass" as its base,
with a bulletinWidgetClass widget on top of it and various other widgets
on the bulletinWidget (buttons, textedit Widgets, etc.)

When I access one of the popup menus, select something, and release the
mouse button, the area covered by the menu when it appeared is not redrawn.

When I, on the other hand, access one of the user interface utilities, like
the aforementioned string dialog box, and make it go away, the area covered
by the dialog box when it appeared IS redrawn.

How can I make the menus redraw what was covered up by their appearing?
This'd save quite a bit of redrawing on my program's behalf.

Thanks for any help that can be provided.

-=-
Stephen N. Spencer      |"For a successful technology, reality must take
ACCAD, 1224 Kinnear Rd. | precedence over public relations, for Nature
Columbus OH 43212       | cannot be fooled."     - Richard P. Feynman
spencer@heinlein.cgrg.ohio-state.edu OR spencer@cis.ohio-state.edu

spencer@heinlein.osc.edu (Stephen N. Spencer) (10/30/89)

Uhhh... I figured it out.  Seems I could set XtNsaveUnder to TRUE for the 
Shell widgets used in building the popup menu.  

But a question:  In Young's book, page 391, under the Shell class definition,
why one of the Boolean default values is spelled "False" and the other two
spelled "FALSE" ?  


-=-
Stephen N. Spencer      |"For a successful technology, reality must take
ACCAD, 1224 Kinnear Rd. | precedence over public relations, for Nature
Columbus OH 43212       | cannot be fooled."     - Richard P. Feynman
spencer@heinlein.cgrg.ohio-state.edu OR spencer@cis.ohio-state.edu

asente@decwrl.dec.com (Paul Asente) (10/31/89)

In article <363@oscsuna.osc.edu> spencer@heinlein.osc.edu (Stephen N. Spencer) writes:
>But a question:  In Young's book, page 391, under the Shell class definition,
>why one of the Boolean default values is spelled "False" and the other two
>spelled "FALSE" ?  

Xlib defines the constants True and False.  The X toolkit defines the
constants TRUE and FALSE.  Use whichever ones you like.

(No, I don't know how or why this happened; life is confusing sometimes.)

	-paul asente
	    asente@decwrl.dec.com	decwrl!asente

lwh@harpsichord.cis.ohio-state.edu (Loyde W Hales) (11/01/89)

In article <363@oscsuna.osc.edu> spencer@heinlein.osc.edu (Stephen N. Spencer) writes:

>But a question:  In Young's book, page 391, under the Shell class definition,
>why one of the Boolean default values is spelled "False" and the other two
>spelled "FALSE" ?  

Actually, the answer is rather stupid and quite C-related.  You see (or is
that ``you C''?), the X library of headers has declared the a ``boolean
type'' in two areas:

	Xlib.h		#define Bool int
			#define True 1
			#define False 0

	Intrinsic.h	typedef Boolean char
			#define FALSE 0
			#define TRUE  1

The former one, being defined at the Xlib level, is the accepted X-ology in
many ways.  The latter one is used by the Widget classes by definition; it is
also the C-normal way of doing things, where macro constants are ALL_CAPS.
(In fact, this definition of TRUE and FALSE are found in many C language
header files:  cgidefs.h, cmpinclude.h, curses.h, usercore.h, and often
stdargs.h.)

So, the bottom line is that both will work--in fact, they are technically
identical.

Yours,



-=-

                                Department of Computer and Information Science
Loyde W. Hales, II                      The Ohio State University
lwh@cis.ohio-state.edu          2036 Neil Avenue Mall, Columbus, Ohio  43201