[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Generic tool



On Sat, 4 Dec 2010 07:07:10 -0800 (PST), WongCK <wongck68@yahoo.com> wrote:
> > The exit  button still doesn't work which I think is to do with
> > app.id (doesn't exist  but is in the dfrm examples). I bodged
> > it with app.avid to make it  compile.
>
>
> Just call exit() to force it to quit.
> May be not what you want (clean up etc) but it ought to quit the program.
>

Clicking on the Exit button (not the window closer) gets into wclose which calls
ApTerm (below) but it doesn't close properly.

  /* catch the AP_TERM message (application termination) */
  while( wglb.first)
  {
    printf("in ApTerm:2\n");
    ApplWrite( app.avid, WM_CLOSED, wglb.first->handle, 0, 0, 0, 0);
    EvntWindom( MU_MESAG);
  }
  ApplExit();
  exit( EXIT_SUCCESS);



typedef struct _appvar {
  /* Public part */

  short  *aes_global; /**< The AES global array (use for mt_AES calls) */
  INT16   aeshdl;     /**< The screen VDI handle used by AES */
  INT16   x,y,w,h;    /**< Coordinates and size of desktop workarea (not screen size) */

  short   color;      /**< Number of colors of screen display */
  short   nplanes;    /**< Number of planes of screen display (e.g. color = 2^nplanes) */
  OBJECT  *menu;          /**< address of the desktop menu tree */
  INT16   work_in[11];    /**< array input of v_opnvwrk() function */
  INT16   work_out[57];   /**< array output of v_opnvwrk() function */
  long   aes4;       /**< bitfield indicating some AES 4 features supported by the OS
                       (see constants \link aes4_status AES4_\endlink) */
  short   avid;       /**< Application AES id of the AV server (or -1) */
  short   ntree;      /**< Number of object trees in the loaded resource */
  char    *pipe;      /**< A user buffer used for AES message exchange (more).
               * ApplInit() reserves a 256 byte buffer allocated in global memory
               * mode pointed by this variable. This buffer can be used to
               * send information safely in MU_MESAG event.
               *
               * For example,
               * \b AV_STARTPROG (AV-protocol) uses \e app->evnt.buff[3-4] to emit a
               * address pointing to a string character. This address should be
               * \e app.pipe.
               */
  int      error;      /**< Last error encountered */

  W_GRAFPORT graf;    /**< Information about the application virtual workstation */
  EVNTvar evnt;       /**< Parameters for evnt_multi() calling */
  WINvar  wglb;       /**< Information about application windows */

  APPRSVD *priv;    /**< Private variables.
             * Private variables are grouped in a hidden structure in order to
             * prevent their utilisation.
             */
  short   gdos; /**< Contains the number of fonts loaded (FIXME: should contain the value returns by vq_gdos() ?) */
} APPvar;