[comp.windows.x] How do I give a popup window a title?

mking@lll-crg.llnl.gov (Marianne King) (04/13/91)

I am creating a popup window using Athena widgets and the XT toolkit.
The command line adding the call back to popup the popup widget follows:

XtAddCallback(button, XtNcallback, XtCallbackNone, (XtPointer) popup);

Everything works great except I am wondering how do I give a title to
the popup window?  

Marianne E. King
Lawrence Livermore National Laboratory
mking@lll-crg.llnl.gov
(415) 423-4116 / (415) 422-3251

bschoen@well.sf.ca.us (Brook Schoenfield) (04/17/91)

mking@lll-crg.llnl.gov (Marianne King) writes:



>I am creating a popup window using Athena widgets and the XT toolkit.

>Everything works great except I am wondering how do I give a title to
>the popup window?  

Popups are "overrideredirect", one of those terms that I had study a
bit before getting: the contemplate your manual school of programming.
What this means is that the window manager, the entity responsible for
such niceties as window titles is being bypassed.  You can set this
for the widget before its mapped.

have fun

-- 


Brook Schoenfield
bschoen@well.sf.ca.us

rthomson@mesa.dsd.es.com (Rich Thomson) (04/18/91)

In article <24254@well.sf.ca.us>
	bschoen@well.sf.ca.us (Brook Schoenfield) writes:
>>I am creating a popup window using Athena widgets and the XT toolkit.
>
>>Everything works great except I am wondering how do I give a title to
>>the popup window?  

Suppose your application is called "foo" and the popup window is
called "baz", try setting the resource: "foo.baz.title: My Title"
and see if you get one.

>Popups are "overrideredirect", [...]
>What this means is that the window manager, the entity responsible for
>such niceties as window titles is being bypassed.

Not quite.  It means that the window manager won't attempt to modify
the geometry request for the window creation.  For instance, all the
dialog boxes I get under mwm have the standard window decorations.  If
under mwm you don't want the decorations, you can always set the
*clientDecorations resource.  (I think you can also call some
MwmMondoHugoLongFunctionName to get the job done as well...)

						-- Rich
-- 
  ``Read my MIPS -- no new VAXes!!'' -- George Bush after sniffing freon
	    Disclaimer: I speak for myself, except as noted.
UUCP: ...!uunet!dsd.es.com!rthomson		Rich Thomson
ARPA: rthomson@dsd.es.com			PEXt Programmer

converse@expo.lcs.mit.EDU (Donna Converse) (04/19/91)

> >I am creating a popup window using Athena widgets and the XT toolkit.
> 
> >Everything works great except I am wondering how do I give a title to
> >the popup window?  

If the shell is a subclass of WMShell, set the title resource.

> Popups are "overrideredirect", 

False, not all shells that are popped up are OverrideShell.

mouse@lightning.mcrcim.mcgill.EDU (der Mouse) (05/02/91)

>> Popups are "overrideredirect", [...]
>> What this means is that the window manager, the entity responsible
>> for such niceties as window titles is being bypassed.

> Not quite.  It means that the window manager won't attempt to modify
> the geometry request for the window creation.

The ICCCM is not entirely clear, to me, on this point: how much are
window managers permitted to meddle with override-redirect windows?
The ICCCM says that override-redirect should not be used except for two
cases, one being a popup such as a menu and the other being a special
case involving ResizeRedirect; I will ignore the latter here.  Quoting:

	4.1.10. Popup Windows
	
	Clients wishing to pop-up a window can do one of three things:
	
	o They can create and map another normal top-level window,
	  which will get decorated and managed as normal by the window
	  manager.  See the discussion of window groups below.
	
	o If the window will be visible for a relatively short time,
	  and deserves a somewhat lighter treatment, they can set the
	  WM_TRANSIENT_FOR property.  They can expect less decoration,
	  but can set all the normal window manager properties on the
	  window.  An example would be a dialog box.
	
	o If the window will be visible for a very short time, and
	  should not be decorated at all, the client can set
	  override-redirect on the window.  In general, this should be
	  done only if the pointer is grabbed while the window is
	  mapped.  The window manager will never interfere with these
	  windows, which should be used with caution.  An example of an
	  appropriate use is a pop-up menu.

It's not clear just what "interfere with" means.  I would assume it
means that the window manager will not do anything with the window,
including reparenting and decorating, but it doesn't quite *say* that.
Certainly all the language that talks about client top-level windows is
careful to keep saying "non-override-redirect" all over the place.

> For instance, all the dialog boxes I get under mwm have the standard
> window decorations.

These sound more like transients (the second item on the list above).
Such windows have WM_TRANSIENT_FOR properties, but don't have
override-redirect set.  Try using xwininfo on one of your dialog boxes
to see whether it really does have override-redirect turned on.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

Dave.Rosenthal@eng.sun.COM (David Rosenthal) (05/11/91)

> The ICCCM is not entirely clear, to me, on this point: how much are
> window managers permitted to meddle with override-redirect windows?

............

> 	o If the window will be visible for a very short time, and
> 	  should not be decorated at all, the client can set
> 	  override-redirect on the window.  In general, this should be
> 	  done only if the pointer is grabbed while the window is
> 	  mapped.  The window manager will never interfere with these
> 	  windows, which should be used with caution.  An example of an
> 	  appropriate use is a pop-up menu.
> 
> It's not clear just what "interfere with" means.  I would assume it
> means that the window manager will not do anything with the window,
> including reparenting and decorating, but it doesn't quite *say* that.

It certainly says that override-redirect windows are not to be decorated:

> 	o If the window will be visible for a very short time, and
> 	  should not be decorated at all, the client can set
          ^^^^^^^^^^^^^^^^^^^^^^^

An ICCCM-compliant window manager will not do anything to ("will
never interfere with") to override-redirect windows.  And please
don't think this is a wonderful opportunity for clients to enforce
decisions about the user interface on the window manager.  The
cautions about not using override-redirect except under specific
conditions should be carefully observed.

	David.