package require BWidget

proc foo {w} {
    tk_messageBox -title "Foo" -message "Hello!" \
	-icon error -type ok -parent [winfo toplevel $w]
}

set fn .dialog
Dialog $fn -title "Dialog" -modal global -parent .
button $fn.b -text "Click me!" -command {foo $fn}
button $fn.q -text "Quit" -command {$fn enddialog 0}
pack $fn.b $fn.q
$fn draw
