Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Icons and the XPM format

157 views
Skip to first unread message

Jesse Hughes

unread,
Nov 4, 1996, 3:00:00 AM11/4/96
to

Hey ho.

I've got a couple of basic questions regarding the icon masks that are
displayed when a window is iconized. I'll probably mangle the jargon
here, but see if you can understand these questions.

I'm running X under linux. Sorry, but I'm clueless enough to be
unable to tell you what version. How do you determine that in X?

Anyway, when I iconify an xterm, say, then there's a handy-dandy li'l
xterm picture that's selected as it's icon mask. For some of my other
applications, the default picture of question marks is chosen, as if X
doesn't know the proper icon for these apps. I don't know how X knows
to select xterm.xpm (which is the mask shown) for xterm, but doesn't
know to select emacs.xpm for emacs (for example).

So, I thought that perhaps I could force the proper selection by
adding a file Emacs to the app-defaults directory. This file contains
only the line

.emacs.iconMask: emacs.xpm

When I start up emacs now, however, I get a message

Warning: Cannot convert string "emacs.xpm" to type Pixmap

If I choose emacs.xbm instead of emacs.xpm, no such message occurs.
Okay, so I'm just being stubborn, here (who really NEEDS color
icons?), but I'd like to learn what I'm doing wrong.

The files are found in /usr/X11/include/X11/bitmaps and
/usr/X11/include/X11/pixmaps (for the xbm and xpm files,
respectively). I assume that this is the right location.

Any ideas for the clueless? Oh, and what IS type Pixmap? I assumed
that XPM was for X Pixmaps.

Thanks,
Jesse

Chad M. Fraleigh

unread,
Nov 4, 1996, 3:00:00 AM11/4/96
to

Jesse Hughes wrote:

> So, I thought that perhaps I could force the proper selection by
> adding a file Emacs to the app-defaults directory. This file contains
> only the line
>
> .emacs.iconMask: emacs.xpm
>
> When I start up emacs now, however, I get a message
>
> Warning: Cannot convert string "emacs.xpm" to type Pixmap
>
> If I choose emacs.xbm instead of emacs.xpm, no such message occurs.
> Okay, so I'm just being stubborn, here (who really NEEDS color
> icons?), but I'd like to learn what I'm doing wrong.

Just as it's called, the iconMask is a mask, not an image. And
since a mask just determines what is and isn't drawn it can only contain
1-bit (monochrome) data. What you seem to want is the 'iconPixmap'
resource, not 'iconMask' (tho they can both be used together to make a
better image).


> Any ideas for the clueless? Oh, and what IS type Pixmap? I assumed
> that XPM was for X Pixmaps.

A pixmap is just a image.. It can be of any color depth (1, 8, 24)
and generally refers to color images, but doesn't have to. On the other
end is bitmaps which are B&W (1-bit color) pixmaps. Pretty much everything
can handle bitmaps, but not all software/Window Managers can handle
multi-color pixmaps.

--
_ _ _ _ _
\--------------------v-----------> > > > > >-----------v--------------------/
< Chad M. Fraleigh | ChadF@IRC | | |*| | | INTJ | ch...@bookcase.com >
/--------------------^-----------<_<_<_<_<_<-----------^--------------------\
< Ctrl Computer Systems, Inc. /|\ http://www.bookcase.com/~chadf/ >
/----------------------------------'-^-`----------------------------------\

Jesse Hughes

unread,
Nov 6, 1996, 3:00:00 AM11/6/96
to

Hey ho.

Thanks for your help. However, I'm still getting some errors.

"Chad M. Fraleigh" <ch...@bookcase.com> writes:
>
> Jesse Hughes wrote:
>
> > So, I thought that perhaps I could force the proper selection by
> > adding a file Emacs to the app-defaults directory. This file contains
> > only the line
> >
> > .emacs.iconMask: emacs.xpm
> >
> > When I start up emacs now, however, I get a message
> >
> > Warning: Cannot convert string "emacs.xpm" to type Pixmap
> >
> > If I choose emacs.xbm instead of emacs.xpm, no such message occurs.
> > Okay, so I'm just being stubborn, here (who really NEEDS color
> > icons?), but I'd like to learn what I'm doing wrong.
>
> Just as it's called, the iconMask is a mask, not an image. And
> since a mask just determines what is and isn't drawn it can only contain
> 1-bit (monochrome) data. What you seem to want is the 'iconPixmap'
> resource, not 'iconMask' (tho they can both be used together to make a
> better image).
>

I've tried using iconPixmap, and I still get the error message shown
above. By the way, how DOES one use both together? I assumed that
since the error message I get when I use the iconMask field refers
explicitly to Pixmap, that Pixmap was acceptable input there. It
seems to me (from the error message) that the problem is not that I'm
sending it a Pixmap file, but that it doesn't recognize it as such.
No?

Thanks again,
Jesse

Phil Cope

unread,
Nov 6, 1996, 3:00:00 AM11/6/96
to

Jesse Hughes wrote:
>
> Hey ho.
>
> Thanks for your help. However, I'm still getting some errors.
>
[snip]

> > > Warning: Cannot convert string "emacs.xpm" to type Pixmap
[snip]

> I've tried using iconPixmap, and I still get the error message shown
> above. By the way, how DOES one use both together?
[snip]

Xt uses a Resource convertor to convert data of different types. Widget
writers and application programmers can install their own convertors
to convert between two different representations of a datum. Obviously
the resource database represents data as character strings. Someone
somewhere has written a convertor that interprets the string as a
bitmap filename, opens it and gets xbm format data out of it. The
convertor presumably gives up either (a) when it sees the xpm extension
or (b) when it tries to make sense of the data in the file as xbm data.

If you're a programmer and have access to the source code of the
application, and you have the Xpm library to hand, then you can write
your own convertor.

I would *guess* that in the Motif 2.0 toolkit the relevant convertors
have been enhanced to read Xpm format bitmap files (since Xpm is part
of Motif 2.0)


> Thanks again,
> Jesse

Phil Cope
--
My opinions do not represent the views of SmallworldWide or
any other organisation or person.

0 new messages