Penso che dovresti lavorare con oggetti di basso livello, tipo window piuttosto che frame.