File: main.c - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off
#define RETURN_VALUE
#include <args.h>
#include <estack.h>
#include <tigcclib.h>
#include <textedit.h>
#include <events.h>
void _main(void)
{
HANDLE dlg = H_NULL;
char titre[200] = "Fichier";
dlg = DialogNewSimple(100,50);
DialogAddTitle(dlg,"Ouvrir",BT_OK,BT_NONE);
DialogAddRequest(dlg,5,15,"Fichier:",0,15,10);
DialogDo(dlg,CENTER,CENTER,titre,NULL);
HeapFree (dlg);
EVENT ev;
TEXT_EDIT te;
HANDLE h = HeapAlloc (200); // initial buffer size
memset (HeapDeref (h), 0, 200);
TE_open (&te, DeskTop, MakeWinRect (0, 17, 159, 93), h, 0, 0, 3);
CU_start (); // Enable the cursor
while (EV_getc (ACTIVITY_BUSY, &ev) != KEY_ESC) // Get keypress and translate it to
{ // the event (until ESC pressed)
TE_handleEvent (&te, &ev); // Send the event to the editor
} // to be processed
FILE *f = NULL; // On prend le texte (je crois qu'il est dans te.Text.h???)
f = fopen("TEST","wb");
if (f != NULL)
{
long *pointeur = NULL,i;
strcpy(titre , "");
for(i=0;i<200;i++)
{
pointeur = &te.Text.h+i;
sprintf(titre, "%s%c",titre,*pointeur);
}
fprintf(f,titre);
}
fclose(f);
TE_close (&te);
return;
}