#############################################################################
# Visual Tcl v1.10 Project
#

#################################
# GLOBAL VARIABLES
#
global widget; 
    set widget(list) {.top17.cpd21.01}
    set widget(m) {.top17.mes18}
    set widget(rev,.top17.cpd21.01) {list}
    set widget(rev,.top17.mes18) {m}

#################################
# USER DEFINED PROCEDURES
#
proc init {argc argv} {
	package require Tk 8.0	
}

init $argc $argv


proc main {argc argv} {
	global tkwait_var
	if [info exists ::tslc_pad] {
		tkwait variable tkwait_var
	}
}

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} }
    }
}

#################################
# VTCL GENERATED GUI PROCEDURES
#

proc vTclWindow. {base} {
    if {$base == ""} {
        set base .
    }
    ###################
    # CREATING WIDGETS
    ###################
    wm focusmodel $base passive
    wm geometry $base 200x200+0+0
    wm maxsize $base 804 585
    wm minsize $base 104 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm withdraw $base
    wm title $base "tk"
    ###################
    # SETTING GEOMETRY
    ###################
}

proc vTclWindow.top17 {base} {
    if {$base == ""} {
        set base .top17
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }
    ###################
    # CREATING WIDGETS
    ###################
    toplevel $base -class Toplevel
    wm focusmodel $base passive
    wm geometry $base 177x200+283+185
    wm maxsize $base 804 585
    wm minsize $base 104 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm deiconify $base
    wm title $base "Namespaces"
    button $base.but19 \
        \
        -command {global widget
foreach n [namespace children ::] {
    $widget(list) insert end $n
}} \
        -text Namespaces 
    frame $base.cpd21 \
        -borderwidth 1 -height 30 -relief raised -width 30 
    listbox $base.cpd21.01 \
        -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -height 0 \
        -width 8 -xscrollcommand {.top17.cpd21.02 set} \
        -yscrollcommand {.top17.cpd21.03 set} 
    scrollbar $base.cpd21.02 \
        -borderwidth 1 -command {.top17.cpd21.01 xview} -orient horiz \
        -width 15 
    scrollbar $base.cpd21.03 \
        -borderwidth 1 -command {.top17.cpd21.01 yview} -orient vert \
        -width 15 
    label $base.lab22 \
        -background #ffff80 -borderwidth 1 -relief raised \
        -text {Click on <Namespace> button} 
    ###################
    # SETTING GEOMETRY
    ###################
    place $base.but19 \
        -x 45 -y 25 -anchor nw -bordermode ignore 
    place $base.cpd21 \
        -x 5 -y 60 -width 165 -height 135 -anchor nw -bordermode ignore 
    grid columnconf $base.cpd21 0 -weight 1
    grid rowconf $base.cpd21 0 -weight 1
    grid $base.cpd21.01 \
        -in .top17.cpd21 -column 0 -row 0 -columnspan 1 -rowspan 1 \
        -sticky nesw 
    grid $base.cpd21.02 \
        -in .top17.cpd21 -column 0 -row 1 -columnspan 1 -rowspan 1 -sticky ew 
    grid $base.cpd21.03 \
        -in .top17.cpd21 -column 1 -row 0 -columnspan 1 -rowspan 1 -sticky ns 
    place $base.lab22 \
        -x 5 -y 5 -width 156 -height 17 -anchor nw -bordermode ignore 
}

Window show .
Window show .top17

main $argc $argv
