Have you tried using onDock and onUndock? I believe they are layout functions I don't remember for sure. Look at std.mi. I know that they were broke in an earlier beta, but I don't know if they have been fixed yet.
edit: I think that they are still dead. The bug is listed as resolve later in bugzilla.