Code: Select all
import "ecere"
class Form1 : Window
{
caption = $"Form1";
background = formColor;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
clientSize = { 320, 304 };
//*** How to call a C function form ecere
extern int myFunction(int val) {
//C code in here
return __GNUC__+val;
}
Label label1 { this, caption = $"label1", position = { 48, 24 } };
Button button1
{
this, caption = $"button1", position = { 144, 72 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
int v;v=1;//value to send to C function
int a=myFunction(v);
char c[100];
sprintf(c,"%d",a);
label1.text=c;
return true;
}
};
}
Form1 form1 {};