#!/bin/sh
# \
  exec wish "$0" "$@"

#
global widget; 

proc init {argc argv} {

}

init $argc $argv


proc {main} {argc argv} {

}

proc {Window} {args} {
global vTcl
    set cmd [lindex $args 0]
    set name [lindex $args 1]
    set newname [lindex $args 2]
    set rest [lrange $args 3 end]
    if {$name == "" || $cmd == ""} {return}
    if {$newname == ""} {
        set newname $name
    }
    set exists [winfo exists $newname]
    switch $cmd {
        show {
            if {$exists == "1" && $name != "."} {wm deiconify $name; return}
            if {[info procs vTclWindow(pre)$name] != ""} {
                eval "vTclWindow(pre)$name $newname $rest"
            }
            if {[info procs vTclWindow$name] != ""} {
                eval "vTclWindow$name $newname $rest"
            }
            if {[info procs vTclWindow(post)$name] != ""} {
                eval "vTclWindow(post)$name $newname $rest"
            }
        }
        hide    { if $exists {wm withdraw $newname; return} }
        iconify { if $exists {wm iconify $newname; return} }
        destroy { if $exists {destroy $newname; return} }
    }
}


proc vTclWindow. {base} {
    if {$base == ""} {
        set base .
    }
    wm focusmodel $base passive
    wm geometry $base 1x1+0+0
    wm maxsize $base 1009 738
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm withdraw $base
    wm title $base "vt.tcl"
}

proc vTclWindow.top25 {base} {
    if {$base == ""} {
        set base .top25
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    toplevel $base -class Toplevel \
        -background #cf1810 
    wm focusmodel $base passive
    wm geometry $base 366x250+243+255
    wm maxsize $base 1009 738
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 0 0
    wm deiconify $base
    wm title $base "Firewall Manager 2.0 PRO HELP"
    label $base.lab26 \
        -anchor nw -background #ce1810 -borderwidth 1 -justify left \
        -relief sunken \
        -text {To Allow "ICMP Log"  option you need to have icmpinfo 
"/usr/sbin/icmpinfo"} 
    label $base.lab28 \
        -background #dc101c -borderwidth 1 -foreground #fcc300 -relief sunken \
        -text {Please send options and Bugs to
labom@internetcom.com.br or
ICQ = 1738663} 
    button $base.but29 \
        -background #c60c08 -command exit -foreground #fefefe -padx 9 -pady 3 \
        -text Exit 
    label $base.lab17 \
        -background #d01810 -borderwidth 1 -justify left -relief sunken \
        -text {This version of Firewall Manager running in anyKernel
version 2.0.x, 2.1.x and 2.2.x.} 
    label $base.lab18 \
        -background #ce1810 -borderwidth 1 -relief ridge \
        -text {To configure system just click in "Get Machine Info" to set
 System Firewall Method (ipfwadm or ipchains).} 
    place $base.lab26 \
        -x 18 -y 45 -width 334 -height 32 -anchor nw -bordermode ignore 
    place $base.lab28 \
        -x 80 -y 180 -width 197 -height 61 -anchor nw -bordermode ignore 
    place $base.but29 \
        -x 310 -y 215 -anchor nw -bordermode ignore 
    place $base.lab17 \
        -x 15 -y 85 -width 342 -height 32 -anchor nw -bordermode ignore 
    place $base.lab18 \
        -x 7 -y 5 -width 353 -height 32 -anchor nw -bordermode ignore 
}

Window show .
Window show .top25

main $argc $argv
