I am trying to use IUP matrix from C like I uses DataGrid from VB.
Till now I come to this:
int refreshl(Ihandle *mat, int from)
{
struct lotstruct lot;
FILE *fol;
fol = fopen("C:/myfolder/myfile", "rb+");
int b;
int temp = 1;
for (b=from; b<(from+31); b++)
{
int rec = sizeof(lot) * (b - 1);
fseek(fol, rec, SEEK_SET);
int fr;
fr = fread(&lot, sizeof(lot), 1, fol);
//------------------------------------
char k1[36] = {0};
strncpy(k1, lot.str1, 35);
char* tp = ibm852_to_cp1250(k1);
char row[6] = {0};
sprintf(row, "%d", temp);
char* ro = ibm852_to_cp1250(row);
char cel1[10] = {0};
sprintf(cel1, "%d%s", temp, ":0");
IupSetAttribute(mat, cel1, ro);
char cel2[10] = {0};
sprintf(cel2, "%d%s", temp, ":1");
IupSetAttribute(mat, cel2, tp);
temp += 1;
}
fclose(fol);
IupSetAttribute(mat, "REDRAW", "ALL");
return 0;
}
With this I read data from binary file and I can see data on console.
But mytrix don't refreshes by changing data. Data is changet by k_any + case K_DOWN function by increasing "from" integer.
So I call "REDRAW" "ALL" but also without result, starting data stays in matrix.
Since I am total beginner please answer to few questions.
1) Is this good idea to use IUP matrix like common windows Grid?
2) How to invoke refresh matrix to change data in it without loosing speed?
3) Can IUP work with UTF-8 strings on windows like gtk can? (I try but without results).