Created
July 29, 2022 12:49
-
-
Save amigojapan/7fe0eb0136636b9d9a67c1b865b06153 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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