#! /usr/bin/wish4.1
#
# $Id: msgDialog,v 1.3 1993/11/16 22:19:22 jason Exp $
#

set TkGnats(lib) /usr/lib/tkgnats; ##TKGNATSLIB##

foreach f { tkgnats.cf.t } {
    source $TkGnats(lib)/$f
}

proc Lc {s} {return $s}

proc msgDialog {w msg} {
    global TkGnats
    catch {destroy $w}
    frame   $w -relief raised -borderwidth 2

    frame   $w.m
    label   $w.m.label -bitmap @$TkGnats(lib)/info.xbm
    message $w.m.msg   -borderwidth 2 -relief sunken -text $msg -aspect 99999
    pack    $w.m.label -side left
    pack    $w.m.msg -side right -padx 6 -pady 6

    frame   $w.bar 
    button  $w.bar.ok -text [Lc "OK"] -command "exit 0"
    pack    $w.bar.ok -side bottom -padx 4 -pady 4
    pack    $w.m   -side top
    pack    $w.bar -side bottom -fill x
    ## bind $w <Visibility> { grab -global %W; focus %W }
    pack    $w -expand true -fill both
}
set exitVal 0
wm title . "Information"
set msg ""
foreach m $argv {append msg "$m\n"}
msgDialog .msgDialog  $msg
wm geometry . [format "+%s+%s" \
 +[expr "[winfo vrootx .]+([winfo screenwidth .]/2)-([winfo reqwidth .]/2)"] \
 +[expr "[winfo vrooty .]+([winfo screenheight .]/2)-([winfo reqheight .]/2)"]]
tkwait window .msgDialog
exit $exitVal
