Skip to content

Instantly share code, notes, and snippets.

@amigojapan
Created July 29, 2022 12:49
Show Gist options
  • Select an option

  • Save amigojapan/7fe0eb0136636b9d9a67c1b865b06153 to your computer and use it in GitHub Desktop.

Select an option

Save amigojapan/7fe0eb0136636b9d9a67c1b865b06153 to your computer and use it in GitHub Desktop.
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 {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment