#! /usr/bin/env tclsh

package require TkXext

pack [frame .controls]
pack [button .controls.b -text "I'm from Tk"] -side left
pack [frame .f -width 200 -height 200 -container 1] -fill both -expand 1
exec firefox http://www.google.com &
set moz [TkXext.find.window Google*];
if {0 eq $moz} {
 return -code error "unable to find the Firefox window"
}
pack [button .controls.x -text X -command [list TkXext.delete.or.kill $moz]] -side right
TkXext.reparent.window $moz [winfo id .f]
bind .f <Configure> [list TkXext.resize.window $moz %w %h]
