Hm thats weird. It feels like im doing the same thing but it wont work.
Take a look at this:
Code:
#include <acknex.h>
#include <default.c>
#define new(TYPE) malloc(sizeof(TYPE))
#define delete(OBJECT) free(OBJECT)
typedef struct
{
int id;
var coolness;
STRING* name;
function lolz();
} ITEM;
ITEM* obj1;
function init_item(ITEM* item, var coolness, STRING* name)
{
static int count = -1;
item.id = ++count;
item.coolness = coolness;
item.name = name;
}
TEXT* pnl =
{
pos_x = 10;
pos_y = 10;
flags = VISIBLE;
}
function test()
{
(pnl.pstring)[0] = "performed";
}
function perform()
{
obj1.lolz();
}
function main()
{
screen_color.blue = 155;
obj1 = new(ITEM);
init_item(obj1, 2, "Hej");
obj1.lolz = test;
on_a = perform;
}