MicroRaptor Gui - Event handling

you register for events with mrg_listen(mrg,event_mask,x,y,width,height,cb,data1,data) which sets up a callbackfunction of type int cb (MrgEvent *event, void *data1, void *data2), if you need to free data when the callback is destroyed (Which it will be next time the ui is painted; and it isn't an active callback (due to drag)). A finalization procedure with its own user_data can be passed using mrg_listen_full.