Hello,
I don't know if it's really the good section for asking this, but I guess there would be more chances to get an answer in here...
I've made an external that is creating a toplevel widget without using t_widgetbehavior, this seem to work good but when I'm trying to implement a 'destroy' message into the C code like this:
static void myToplevelWidget_free(t_myToplevelWidget *x) { post( "myToplevelWidget: freeing ressources [NULL]" );
sys_vgui("set w .x%x\n",x );
sys_vgui("destroy $w\n");
}
extern "C" MYTOPLEVELWIDGET_EXTERNAL void myToplevelWidget_setup(void)
{
proll_class = class_new(gensym("myToplevelWidget"),
(t_newmethod)myToplevelWidget_new,
(t_method)myToplevelWidget_free,
sizeof(t_myToplevelWidget), 0, A_GIMME, 0);
...
<snip>
}
(yes, it's C embedded in CPP for some reasons...)
pd is crashing when I delete the external, but if I send a destroy message like this:
static void myToplevelWidget_destroy(t_myToplevelWidget* x) { sys_vgui("set w .x%x\n",x ); sys_vgui("destroy $w\n"); }
for deleting the widget by sending a message to the external, it's not crashing.
Any idea about what I am missing?
the project is attached if someone would like to try it out (needs to be compiled) also I'd be glad to know if it compiles on linux and OSX...