[comp.sys.hp] question about HPWM and icons on HP9000/340

edwin@praxis.cs.ruu.nl (Edwin Kremer) (09/12/89)

Hi,
	I still didn't manage to specify an icon image to a X
	client on HP-UX 6.5 with the HPWM window manager. I've just
	upgraded to HP-UX 6.5 and decided to use HPWM instead of
	TWM on my HP9000/340, just to compare both of them.

What I want is to run a "normal" UNIX tool in a HPTERM client and
specify a dedicated icon for it. The example below shows how I
run the Elm Mail Agent from a HPWM menu:

Menu "button3"
{
  "Mail Agent"  !"hpterm =80x36 -iconic -vb -name elm -tn hp2622 -e elm &"
}


This is an abstract from my '.Xdefaults':

	Hpwm*bitmapDirectory:		/usr/staff/include/X11/bitmaps
	Hpwm*elm.iconImage:		elm.icon
	Hpwm*HPterm.iconImage:		shell.icon
	Hpwm*default*iconImage:		default.icon

What happens is this:

	- every iconified unknown client uses "default.icon". That's fine.
	- every iconified HPTERM to use "shell.icon". Looks good, but...
	- an iconified mail agent *also* uses "shell.icon". Too bad...

The HPTERM manual says: 'the -name <name> options specifies the application
	name under which resources are to be obtained, rather than the
	default executable file name ("hpterm").'

Why oh why is ELM ignoring the "elm.icon" image and still
using "shell.icon" ?????? (Or is it impossible to specify an
icon image for a utility that is not a X client itself but instead
runs in a X client ??)

Thanks in advance for any help...

					--[ Edwin ]--


--
Edwin Kremer, Department of Computer Science, University of Utrecht
Padualaan 14,  P.O. Box 80.089,  3508 TB  Utrecht,  The Netherlands
Phone : +31 - 30 - 534104     |     Telefax: +31 - 30 - 513791
E-Mail: edwin@cs.ruu.nl       |     UUCP to: ...!hp4nl!ruuinf!edwin

keith@hpcvlx.cv.hp.com (Keith Taylor) (09/13/89)

>...
>What I want is to run a "normal" UNIX tool in a HPTERM client and
>specify a dedicated icon for it. The example below shows how I
>run the Elm Mail Agent from a HPWM menu:
>
>...
>
>This is an abstract from my '.Xdefaults':
>
>	Hpwm*bitmapDirectory:		/usr/staff/include/X11/bitmaps
>	Hpwm*elm.iconImage:		elm.icon
>	Hpwm*HPterm.iconImage:		shell.icon
>	Hpwm*default*iconImage:		default.icon
>
>What happens is this:
>
>	- every iconified unknown client uses "default.icon". That's fine.
>	- every iconified HPTERM to use "shell.icon". Looks good, but...
>	- an iconified mail agent *also* uses "shell.icon". Too bad...

Hpwm assigns iconImages on a client "class" basis (see description of
WM_CLASS property). Hence, all clients of the class "HPterm" get the 
same iconImage. What you want, assignment by client "name", is one of 
the most requested enhancements for hpwm.  This feature is available 
in the OSF/Motif window manager, mwm, which will be in HP-UX 7.0. (Mwm 
is very similar to hpwm, by the way.)

>
>The HPTERM manual says: 'the -name <name> options specifies the application
>	name under which resources are to be obtained, rather than the
>	default executable file name ("hpterm").'
>
>Why oh why is ELM ignoring the "elm.icon" image and still
>using "shell.icon" ?????? (Or is it impossible to specify an
>icon image for a utility that is not a X client itself but instead
>runs in a X client ??)
>

The Hpwm*... resources are picked up by hpwm, not by elm or hpterm.
Specifying an Hpwm*<clientclass>*iconImage allows you to override
client supplied icon images. The client is not aware that the window
manager is displaying a different image.


Keith M. Taylor
Hewlett-Packard
Corvallis, Oregon

shankar@hpclscu.HP.COM (Shankar Unni) (09/14/89)

> The HPTERM manual says: 'the -name <name> options specifies the application
> 	name under which resources are to be obtained, rather than the
> 	default executable file name ("hpterm").'
> 
> Why oh why is ELM ignoring the "elm.icon" image and still
> using "shell.icon" ?????? (Or is it impossible to specify an
> icon image for a utility that is not a X client itself but instead
> runs in a X client ??)

Because -name "name" changes only the instance name, not the class name.
In this case, the hpterm window's name changes from "hpterm" to "elm".

Unfortunately, Hpwm does *not* look at instance names, only class names (I
know, I know..). So for this case, at least, you cannot achieve what you
want to.

I cannot think of any easy workaround for this..
-----
Shankar Unni                                   E-Mail: 
Hewlett-Packard California Language Lab.     Internet: shankar@hpda.hp.com
Phone : (408) 447-5797                           UUCP: ...!hplabs!hpda!shankar

stroyan@hpfcdc.HP.COM (Mike Stroyan) (09/14/89)

> What I want is to run a "normal" UNIX tool in a HPTERM client and
> specify a dedicated icon for it. The example below shows how I
> run the Elm Mail Agent from a HPWM menu:

I'm afraid that you are out of luck with hpwm.  The WM_CLASS property
consists of a resource name and resource class.  The -name option to
hpterm sets the resource name, but leaves the resource class as
"HPterm".  The client class specific resources in hpwm only look at the
resource class part of the property.  To get different hpterm icons you
will need to use twm or wait for mwm, which will ship with HP-UX 7.0.
Twm can set icons based on window titles.  Mwm can set icons based on
either field in the WM_CLASS property, and would work with your example.

Mike Stroyan, stroyan@hpfcla.hp.com

scott@grlab.UUCP (Scott Blachowicz) (09/14/89)

In article <1566@ruuinf.cs.ruu.nl> edwin@praxis.cs.ruu.nl (Edwin Kremer) writes:

>    "Mail Agent"  !"hpterm =80x36 -iconic -vb -name elm -tn hp2622 -e elm &"
> ...
>  This is an abstract from my '.Xdefaults':
>     Hpwm*bitmapDirectory:		/usr/staff/include/X11/bitmaps
>     Hpwm*elm.iconImage:		elm.icon
>     Hpwm*HPterm.iconImage:		shell.icon
>     Hpwm*default*iconImage:		default.icon
> ...
>  The HPTERM manual says: 'the -name <name> options specifies the application
>     name under which resources are to be obtained, rather than the
>     default executable file name ("hpterm").'
> ...
>  Why oh why is ELM ignoring the "elm.icon" image and still
>  using "shell.icon" ?????? (Or is it impossible to specify an
>  icon image for a utility that is not a X client itself but instead
>  runs in a X client ??)
Some problems above:
   1) ELM has nothing to do with the behavior. It doesn't know anything 
      about X.
   2) HPWM's behavior is what has you confused. All of those "Hpwm*"
      resources are read by hpwm. It looks at the WM_CLASS property of the
      client window, then looks up things like iconImage with that. The
      -name option on hpterm just sets the WM_NAME property (not WM_CLASS),
      so your ELM window appears to HPWM to be just another HPterm window.
      It would be REAL nice if there were a way to have HPWM do the lookup
      under the WM_NAME instead. Maybe something like...
         /* default for lookupClients resource is class */
         Hpwm*HPterm.lookupClients:   name
         Hpwm*elm*iconImage:          elm.icon
         /* This is the default for HPterm-class clients */
         Hpwm*HPterm*iconImage:       shell.icon
--
Scott Blachowicz                E-mail:  scott@grlab.UUCP
USPS:  Graphicus                 ..or..  ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA 98033       FAX:     206/828-4236

edwin@praxis.cs.ruu.nl (Edwin Kremer) (09/15/89)

In article <5570290@hpfcdc.HP.COM> stroyan@hpfcdc.HP.COM (Mike Stroyan) writes:

  >I'm afraid that you are out of luck with hpwm.  The WM_CLASS property
  >consists of a resource name and resource class.  The -name option to
  >hpterm sets the resource name, but leaves the resource class as
  >"HPterm".

Thanks a lot to all of you who responded to my question
about HPWM, especially all the guys at HP.COM.
Ok, I preferred a solution, but right now I know that I don't have
to try any longer...

					--[ Edwin ]--
--
Edwin Kremer, Department of Computer Science, University of Utrecht
Padualaan 14,  P.O. Box 80.089,  3508 TB  Utrecht,  The Netherlands
Phone : +31 - 30 - 534104     |     Telefax: +31 - 30 - 513791
E-Mail: edwin@cs.ruu.nl       |     UUCP to: ...!hp4nl!ruuinf!edwin