mycanvas._setparent(mywindow2)
This tweak should be converted to a new maxgui function (SetGadgetGroup) and posted in the Module Tweaks forum. Skid & mark could then make it an official addition (which is much more likely when it works cross-platform).