Re: [AD] Proposal for a set_icon function

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


To do all that mess we could just add a windows only function
set_window_icon(HICON icon);

that would have to be called before creating the window
dont you think? =)

the user would only have to create a resource file, compile it to an obj (by
him/herself, users are not so stupid after all ;) and link it to the allegro
program that has that function and voila! icon linked in your exe and in
your window

for other OSes this function could change (and of course be on their own
OSdependant header), so the user could do
#ifdef ALLEGRO_WINDOWS
set_icon(LoadIcon(bla bla);
#else ifdef ALLEGRO_BEOS
set_icon(bla bla , bla bla);
#endif


----- Original Message -----
From: "Eric Botcazou" <ebotcazou@xxxxxxxxxx>
To: "Allegro conductors" <conductors@xxxxxxxxxx>
Sent: Thursday, August 16, 2001 10:53 PM
Subject: Re: [AD] Proposal for a set_icon function


> Here's another proposal:
>
> ---
> Rationale:
> Icons are a very platform specific thing: they don't exist on some (DOS,
> Linux console), they are statically attached to executables on others
> (Windows), they can be dynamically attached on others (BeOS ?), they are
> separate objects on others (Unixes/X)...
>
> Proposal:
> Icons management should stay a platform specific business and not be
> integrated into the API. Allegro should only provide utilities on a
platform
> basis to ease the things.
> ---
>
> For Windows: we could build a little utility/script that, when passed a
dat
> file containing bitmaps, will output an object file ready to be linked
into
> the user executable. The two main steps would be converting the Allegro
> bitmap to a Windows icon then invoking the resource compiler (obviously
> compiler dependent) on it to produce an object file that wraps it. We
could
> also make so that Allegro automatically loads the icon when it is creating
> the main window.
>
> ---
> Eric Botcazou
> ebotcazou@xxxxxxxxxx
>
>



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