Re: [AD] OSX - About dialog

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


On Thursday 13 October 2005 03:43 pm, Evert Glebbeek wrote:
> There is a difference though: there's no standard way for an Allegro
> application to have an `about' dialog in Windows (since it has no menu
> bar) or X11 (same).

You could have a system/graphics driver vtable entry, and just hook OSX's 
'About...' menu function with it. Given that to have a menu bar, it needs to 
have a window/graphics mode set, you could do it by using a custom Allegro 
DIALOG. Something like:

int display_about_dialog(const char *img_file, const char *text_file)
{
   if(!gfx_driver)
      return FALSE;
   if(gfx_driver->show_about)
      return gfx_driver->show_about(img_file, text_file);

   about_dialog[f].dp = load_bitmap(img_file, pal);
   about_dialog[b].dp = load_text(text_file);

   do_dialog(about_dialog, -1);

   destroy_bitmap(about_dialog[f].dp);
   about_dialog[f].dp = NULL;
   free(about_dialog[b].dp);
   about_dialog[b].dp = NULL;

   return TRUE;
}

then:
set_osx_about_hook(display_about_dialog);

Of course it'd be a bit more complex than that, but I could probably throw a 
simple one together easilly enough. The main problem would be that there'd be 
no way to easilly parse HTML.. which is why it'd probably be better to not 
make it an OSX specific thing.




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