/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Menu2.Msgs.c
    Author:  Copyright  1995 Julian Smith
    Version: 1.00 (12 Jul 1995)
    Purpose: Creating menus using message tags for menu title and 
             specification
*/

#include "Desk.Msgs.h"
#include "Desk.Menu2.h"
#include "Desk.Str.h"


Desk_menu2_handle	Desk_Menu2_CreateFromMsgs(
			const char	*titletag,
			const char	*spectag,
			Desk_menu2_makefn	makefn,
			Desk_menu2_flagsfn	flagsfn,
			Desk_menu2_subfn	subfn,
			Desk_menu2_selectfn	selectfn,
			Desk_menu2_closefn	closefn,
			Desk_menu2_helpfn	helpfn,
			void	*reference
			)
{
char	specbuffer[ 256];
char	titlebuffer[ 16];
char	*spec, *title;

Desk_Msgs_Lookup( titletag, titlebuffer, 15);
Desk_Msgs_Lookup( spectag, specbuffer, 255);
spec = Desk_strdup( specbuffer);
title = Desk_strdup( titlebuffer);

return Desk_Menu2_Create2( title, spec, makefn, flagsfn, subfn, selectfn, closefn, helpfn, reference);
}

