Re: [AD] Proposal for a set_icon function

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 30 Aug 2001, Angelo Mottola <a.mottola@xxxxxxxxxx> wrote:
> >> >> A ufixicon should also be possible, and it would be used to generate a
> >> >> .xpm icon. What do you think?
> >I'd do it, but is it really necessary?  ImageMagick's `convert'
> >would probably do a better job anyway.
> 
> Sure, but not everyone has ImageMagick installed... 

I would have thought otherwise.  Anyway, I'm attaching an incomplete
one.  I don't have time to finish it right now.  I don't understand
Colormaps, so I didn't get the 8 bpp version to go.

> Btw, is there a way to tell a Linux Allegro program to use a specific icon for 
> its window?

Yes.  I don't have my test program around any more, but the
WindowMaker FAQ says:

"""
6.1 How do I get a normal X application to produce an appicon? 
----------------------------------
 You must define the WM_CLASS (XSetClassHint()) and the
CLIENT_LEADER or XWMHints.window_group properties, which are
automatically set by most applications that use Xt (Motif, Athena ...),
but if you use plain Xlib you must set them by hand. 

Also you must make a call to XSetCommand(dpy, leader, argv, argc); 

Take a look at Window Maker-0.1x.x/test/test.c that is an example for
writing such an app (which also have an app menu).
"""


IMO, a more interesting (and useful) thing that `ufixicon' could do
is to convert a bitmap into a C code representation (like xpm, but
simpler) and generate a function that sets the window's icon.  The
two things would appear in one file, and get linked by the user.

Or we could supply a xwin_set_icon(BITMAP *) function.  Unlike other
systems, you _have to_ set the icon at runtime (that's the excuse).
There is no required icon format on disk, so we don't need the xpm
converter in this case either.

-- 
tjaden@xxxxxxxxxx - http://www.alphalink.com.au/~tjaden/
MALLMANAC.  In a mall, the giant maze with blocks and numbers on it,
otherwise known as the "Directory".  -- Rich Hall, "Sniglets"

Attachment: ufixicon.c.gz
Description: application/gunzip



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/