A subcommand of Tk's winfo command.
winfo toplevel window
Returns the path name of the top-level window containing window.
See also:
Category Command | Tk syntax help | Arts and Crafts of Tcl-Tk Programming