home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / software / utilities / installer / gui api / example / igui_askstring.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-27  |  1.9 KB  |  88 lines

  1.  
  2. #include "includes.h"
  3. #include "installergui_data.h"
  4.  
  5. #include <string.h>
  6.  
  7. /********************************************************************
  8.  *
  9.  *  DESCRIPTION
  10.  *
  11.  */
  12.  
  13. /********************************************************************
  14.  *
  15.  *  STATIC
  16.  *
  17.  */
  18.  
  19. /********************************************************************
  20.  *
  21.  *  EXTERN
  22.  *
  23.  */
  24.  
  25. /********************************************************************
  26.  *
  27.  *  PUBLIC
  28.  *
  29.  */
  30.  
  31. /********************************************************************
  32.  *
  33.  *  CODE
  34.  *
  35.  */
  36.  
  37. char * __asm igui_AskString(register __a0 APTR application,
  38.                             register __a1 struct FunctionEnvironment *localenv)
  39. {
  40.   #ifdef DEBUG
  41.   DEBUG_MAKRO
  42.   #endif
  43.  
  44.   {
  45.     struct Application *app = (struct Application *) application;
  46.  
  47.     APTR str, txt = NULL;
  48.     APTR strobj,
  49.          obj = GroupObject,
  50.                  Child, HVSpace,
  51.                  Child, TextObject,
  52.                    MUIA_Frame, MUIV_Frame_None, //MUIV_Frame_Text,
  53.                    MUIA_Text_Contents, localenv->fe_Prompt,
  54.                    MUIA_Text_SetMin, TRUE,
  55.                    MUIA_Text_PreParse, "\33c",
  56.                  End,
  57.                  Child, strobj = StringObject,
  58.                    MUIA_Frame, MUIV_Frame_String,
  59.                    MUIA_String_Contents, localenv->fe_Default,
  60.                    MUIA_String_Format, MUIV_String_Format_Center,
  61.                  End,
  62.                  Child, HVSpace,
  63.                End;
  64.  
  65.     //
  66.     if (guistuff_NewContent(app, obj))
  67.     {
  68.       //
  69.       igui_WaitApp(app);
  70.       if (!igui_QuitApp(app))
  71.       {
  72.         //
  73.         GetAttr(MUIA_String_Contents, strobj, (ULONG *) &str);
  74.  
  75.         txt = sav_AllocVec(strlen(str) + 1, MEMF_ANY);
  76.         if (txt) { strcpy(txt, str); }
  77.         else     { /* NO MEMORY */ }
  78.       }
  79.  
  80.       igui_EmptyPanel(app);
  81.     }
  82.     else { /* NO GUI OBJECT */ }
  83.  
  84.     return(txt);
  85.   }
  86. }
  87.  
  88.