#!/bin/sh
# the next line restarts using wish\
exec wish "$0" "$@" 

if {![info exists vTcl(sourcing)]} {

    # Provoke name search
    catch {package require bogus-package-name}
    set packageNames [package names]

    switch $tcl_platform(platform) {
	windows {
            option add *Button.padY 0
	}
	default {
	    option add *Scrollbar.width 10
            option add *Scrollbar.highlightThickness 0
            option add *Scrollbar.elementBorderWidth 2
            option add *Scrollbar.borderWidth 2
	}
    }
    
    # Needs Itcl
    package require Itcl

    # Needs Itk
    package require Itk

    # Needs Iwidgets
    package require Iwidgets

    switch $tcl_platform(platform) {
	windows {
            option add *Pushbutton.padY         0
	}
	default {
	    option add *Scrolledhtml.sbWidth    10
	    option add *Scrolledtext.sbWidth    10
	    option add *Scrolledlistbox.sbWidth 10
	    option add *Hierarchy.sbWidth       10
            option add *Pushbutton.padY         2
        }
    }
    
}

#############################################################################
# Visual Tcl v1.60 Project
#

#############################################################################
# vTcl Code to Load Stock Fonts


if {![info exist vTcl(sourcing)]} {
set vTcl(fonts,counter) 0
#############################################################################
## Procedure:  vTcl:font:add_font

proc {vTcl:font:add_font} {font_descr font_type {newkey {}}} {
     global vTcl

     incr vTcl(fonts,counter)
     set newfont [eval font create $font_descr]

     lappend vTcl(fonts,objects) $newfont

     # each font has its unique key so that when a project is
     # reloaded, the key is used to find the font description

     if {$newkey == ""} {
          set newkey vTcl:font$vTcl(fonts,counter)

          # let's find an unused font key
          while {[vTcl:font:get_font $newkey] != ""} {
             incr vTcl(fonts,counter)
             set newkey vTcl:font$vTcl(fonts,counter)
          }
     }

     set vTcl(fonts,$newfont,type)                      $font_type
     set vTcl(fonts,$newfont,key)                       $newkey
     set vTcl(fonts,$vTcl(fonts,$newfont,key),object)   $newfont

     lappend vTcl(fonts,$font_type) $newfont

     # in case caller needs it
     return $newfont
}

#############################################################################
## Procedure:  vTcl:font:get_font

proc {vTcl:font:get_font} {key} {
    global vTcl
    if {[info exists vTcl(fonts,$key,object)]} then {
        return $vTcl(fonts,$key,object)
    } else {
        return ""
    }
}

vTcl:font:add_font \
    "-family helvetica -size 12 -weight normal -slant roman -underline 0 -overstrike 0" \
    stock \
    vTcl:font1
}
#################################
# VTCL LIBRARY PROCEDURES
#

if {![info exists vTcl(sourcing)]} {
#############################################################################
## Library Procedure:  Window

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 }
    if {$name == "."} { wm withdraw $name; return }
    set exists [winfo exists $newname]
    switch $cmd {
        show {
            if {$exists} {
                wm deiconify $newname
            } elseif {[info procs vTclWindow$name] != ""} {
                eval "vTclWindow$name $newname $rest"
            }
            if {[winfo exists $newname] && [wm state $newname] == "normal"} {
                vTcl:FireEvent $newname <<Show>>
            }
        }
        hide    {
            if {$exists} {
                wm withdraw $newname
                vTcl:FireEvent $newname <<Hide>>
                return}
        }
        iconify { if $exists {wm iconify $newname; return} }
        destroy { if $exists {destroy $newname; return} }
    }
}
#############################################################################
## Library Procedure:  vTcl:DefineAlias

proc {vTcl:DefineAlias} {target alias widgetProc top_or_alias cmdalias} {
    global widget
    set widget($alias) $target
    set widget(rev,$target) $alias
    if {$cmdalias} {
        interp alias {} $alias {} $widgetProc $target
    }
    if {$top_or_alias != ""} {
        set widget($top_or_alias,$alias) $target
        if {$cmdalias} {
            interp alias {} $top_or_alias.$alias {} $widgetProc $target
        }
    }
}
#############################################################################
## Library Procedure:  vTcl:DoCmdOption

proc {vTcl:DoCmdOption} {target cmd} {

    ## menus are considered toplevel windows
    set parent $target
    while {[winfo class $parent] == "Menu"} {
        set parent [winfo parent $parent]
    }

    regsub -all {\%widget} $cmd $target cmd
    regsub -all {\%top} $cmd [winfo toplevel $parent] cmd

    uplevel #0 [list eval $cmd]
}
#############################################################################
## Library Procedure:  vTcl:FireEvent

proc {vTcl:FireEvent} {target event {params {}}} {
    ## The window may have disappeared
    if {![winfo exists $target]} return
    ## Process each binding tag, looking for the event
    foreach bindtag [bindtags $target] {
        set tag_events [bind $bindtag]
        set stop_processing 0
        foreach tag_event $tag_events {
            if {$tag_event == $event} {
                set bind_code [bind $bindtag $tag_event]
                foreach rep "\{%W $target\} $params" {
                    regsub -all [lindex $rep 0] $bind_code [lindex $rep 1] bind_code
                }
                set result [catch {uplevel #0 $bind_code} errortext]
                if {$result == 3} {
                    ## break exception, stop processing
                    set stop_processing 1
                } elseif {$result != 0} {
                    bgerror $errortext
                }
                break
            }
        }
        if {$stop_processing} {break}
    }
}
#############################################################################
## Library Procedure:  vTcl:Toplevel:WidgetProc

proc {vTcl:Toplevel:WidgetProc} {w args} {
    if {[llength $args] == 0} {
        ## If no arguments, returns the path the alias points to
        return $w
    }
    ## The first argument is a switch, they must be doing a configure.
    if {[string index $args 0] == "-"} {
        set command configure
        ## There's only one argument, must be a cget.
        if {[llength $args] == 1} {
            set command cget
        }
    } else {
        set command [lindex $args 0]
        set args [lrange $args 1 end]
    }
    switch -- $command {
        "hide" - "Hide" - "show" - "Show" {
            Window [string tolower $command] $w
        }
        "ShowModal" {
            Window show $w
            raise $w
            grab $w
            tkwait window $w
            grab release $w
        }
        default {
            uplevel $w $command $args
        }
    }
}
#############################################################################
## Library Procedure:  vTcl:WidgetProc

proc {vTcl:WidgetProc} {w args} {
    if {[llength $args] == 0} {
        ## If no arguments, returns the path the alias points to
        return $w
    }
    ## The first argument is a switch, they must be doing a configure.
    if {[string index $args 0] == "-"} {
        set command configure
        ## There's only one argument, must be a cget.
        if {[llength $args] == 1} {
            set command cget
        }
    } else {
        set command [lindex $args 0]
        set args [lrange $args 1 end]
    }
    uplevel $w $command $args
}
#############################################################################
## Library Procedure:  vTcl:toplevel

proc {vTcl:toplevel} {args} {
    uplevel #0 eval toplevel $args
    set target [lindex $args 0]
    namespace eval ::$target {}
}
}


if {[info exists vTcl(sourcing)]} {

proc vTcl:project:info {} {
    namespace eval ::widgets::.top64 {
        array set save {-background 1 -borderwidth 1 -highlightbackground 1 -menu 1 -relief 1}
        set set,origin 1
        set set,size 1
    }
    namespace eval ::widgets::.top64.sca70 {
        array set save {-activebackground 1 -background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1 -width 1}
    }
    namespace eval ::widgets::.top64.sca71 {
        array set save {-activebackground 1 -background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.sca72 {
        array set save {-background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent76 {
        array set save {-background 1 -highlightbackground 1 -highlightthickness 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.ent77 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.ent78 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -takefocus 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.sca79 {
        array set save {-background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent81 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.sca82 {
        array set save {-activebackground 1 -background 1 -bigincrement 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent83 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.but99 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.ent65 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.but64 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.ent66 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.but67 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.ent64 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.but65 {
        array set save {-activebackground 1 -background 1 -command 1 -text 1}
    }
    namespace eval ::widgets::.top64.ent67 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.sca68 {
        array set save {-background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent69 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.che70 {
        array set save {-activebackground 1 -background 1 -state 1 -text 1 -variable 1}
    }
    namespace eval ::widgets::.top64.che65 {
        array set save {-background 1 -labelpos 1 -labeltext 1 -selectcolor 1}
        namespace eval subOptions {
            array set save {-anchor 1 -disabledforeground 1 -font 1 -highlightthickness 1 -justify 1 -onvalue 1 -selectcolor 1 -text 1 -variable 1}
        }
    }
    namespace eval ::widgets::.top64.che66 {
        array set save {-background 1 -labelpos 1 -labeltext 1 -selectcolor 1}
        namespace eval subOptions {
            array set save {-anchor 1 -disabledforeground 1 -font 1 -highlightthickness 1 -justify 1 -onvalue 1 -selectcolor 1 -text 1 -variable 1}
        }
    }
    namespace eval ::widgets::.top64.but66 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.but68 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.but69 {
        array set save {-background 1 -command 1 -disabledforeground 1 -text 1}
    }
    namespace eval ::widgets::.top64.ent68 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.ent70 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.ent71 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.sca73 {
        array set save {-background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent74 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.sca75 {
        array set save {-background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -sliderlength 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets::.top64.ent79 {
        array set save {-background 1 -highlightbackground 1 -insertbackground 1 -relief 1 -selectbackground 1 -textvariable 1 -width 1}
    }
    namespace eval ::widgets::.top64.che80 {
        array set save {-background 1 -labeltext 1 -selectcolor 1}
        namespace eval subOptions {
            array set save {-anchor 1 -background 1 -disabledforeground 1 -font 1 -highlightbackground 1 -highlightthickness 1 -justify 1 -onvalue 1 -selectcolor 1 -state 1 -text 1 -variable 1}
        }
    }
    namespace eval ::widgets::.top64.but81 {
        array set save {-background 1 -command 1 -text 1}
    }
    namespace eval ::widgets::.top64.but82 {
        array set save {-background 1 -command 1 -font 1 -text 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.ent72 {
        array set save {-background 1 -textvariable 1}
    }
    namespace eval ::widgets::.top64.sca74 {
        array set save {-activebackground 1 -background 1 -bigincrement 1 -from 1 -label 1 -orient 1 -resolution 1 -tickinterval 1 -to 1 -troughcolor 1 -variable 1}
    }
    namespace eval ::widgets_bindings {
        set tagslist _TopLevel
    }
}
}

#################################
# USER DEFINED PROCEDURES
#
#############################################################################
## Procedure:  main

proc {main} {argc argv} {

}

#############################################################################
## Initialization Procedure:  init

proc {init} {argc argv} {

}

init $argc $argv

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

proc vTclWindow. {base} {
    if {$base == ""} {
        set base .
    }
    ###################
    # CREATING WIDGETS
    ###################
    wm focusmodel $base passive
    wm geometry $base 1x1+0+0; update
    wm maxsize $base 1137 834
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm withdraw $base
    wm title $base "vtcl.tcl"
    bindtags $base "$base Vtcl.tcl all"
    vTcl:FireEvent $base <<Create>>
    wm protocol $base WM_DELETE_WINDOW "vTcl:FireEvent $base <<DeleteWindow>>"

    ###################
    # SETTING GEOMETRY
    ###################

    vTcl:FireEvent $base <<Ready>>
}

proc vTclWindow.top64 {base} {
    if {$base == ""} {
        set base .top64
    }
    if {[winfo exists $base]} {
        wm deiconify $base; return
    }

    global widget
    vTcl:DefineAlias "$base" "Toplevel1" vTcl:Toplevel:WidgetProc "" 1
    vTcl:DefineAlias "$base.but64" "Button2" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but65" "Button4" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but66" "Button5" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but67" "Button3" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but68" "Button6" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but69" "Button7" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but81" "Button8" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but82" "Button9" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.but99" "Button1" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.che65" "Checkbox2" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.che66" "Checkbox3" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.che70" "Checkbutton1" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.che80" "Checkbox4" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent64" "Entry11" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent65" "Entry9" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent66" "Entry10" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent67" "Entry12" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent68" "Entry14" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent69" "Entry13" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent70" "Entry15" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent71" "Entry16" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent72" "Entry19" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent74" "Entry17" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent76" "Entry2" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent77" "Entry3" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent78" "Entry4" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent79" "Entry18" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent81" "Entry6" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.ent83" "Entry7" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca68" "Scale7" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca70" "Scale1" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca71" "Scale2" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca72" "Scale3" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca73" "Scale8" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca74" "Scale10" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca75" "Scale9" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca79" "Scale4" vTcl:WidgetProc "Toplevel1" 1
    vTcl:DefineAlias "$base.sca82" "Scale5" vTcl:WidgetProc "Toplevel1" 1

    ###################
    # CREATING WIDGETS
    ###################
    vTcl:toplevel $base -class Toplevel \
        -background #79e79e799658 -borderwidth 5 \
        -highlightbackground #befbcf3cc71b -menu -relief -relief flat 
    wm focusmodel $base passive
    wm geometry $base 1000x400+58+60; update
    wm maxsize $base 1137 834
    wm minsize $base 1 1
    wm overrideredirect $base 0
    wm resizable $base 0 1
    wm deiconify $base
    wm title $base "tkAmber"
    bindtags $base "$base Toplevel all _TopLevel"
    vTcl:FireEvent $base <<Create>>
    wm protocol $base WM_DELETE_WINDOW "vTcl:FireEvent $base <<DeleteWindow>>"

    scale $base.sca70 \
        -activebackground #b97acf3cc22e -background #79e79e799658 \
        -bigincrement 0.0 -from 0.0003 -label InitialGrainSize \
        -orient horizontal -resolution 0.0001 -sliderlength 20 \
        -tickinterval 0.0 -to 1.0 -troughcolor #befbcf3cc71b \
        -variable InitialGrainSize -width 15 
    bindtags $base.sca70 "Scale $base all $base.sca70"
    scale $base.sca71 \
        -activebackground #b97acf3cc22e -background #79e79e799658 \
        -bigincrement 0.0 -from 0.0003 -label FinalGrainSize \
        -orient horizontal -resolution 0.0001 -sliderlength 20 \
        -tickinterval 0.0 -to 1.0 -troughcolor #befbcf3cc71b \
        -variable FinalGrainSize 
    bindtags $base.sca71 "Scale $base all $base.sca71"
    scale $base.sca72 \
        -background #79e79e799658 -bigincrement 0.0 -from 1.0 \
        -label InitialDensity -orient horizontal -sliderlength 20 \
        -tickinterval 0.0 -to 44100.0 -troughcolor #befbcf3cc71b \
        -variable InitialDensity 
    bindtags $base.sca72 "Scale $base all $base.sca72"
    entry $base.ent76 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -highlightthickness 1 -insertbackground black -relief groove \
        -selectbackground #cccccc -textvariable FinalGrainSize -width 48 
    entry $base.ent77 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable InitialGrainSize -width 48 
    entry $base.ent78 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -takefocus {} -textvariable InitialDensity -width 48 
    scale $base.sca79 \
        -background #79e79e799658 -bigincrement 0.0 -from 1.0 \
        -label FinalDensity -orient horizontal -resolution 1.0 \
        -sliderlength 20 -to 44100.0 -troughcolor #befbcf3cc71b \
        -variable FinalDensity 
    bindtags $base.sca79 "Scale $base all $base.sca79"
    entry $base.ent81 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable FinalDensity -width 48 
    scale $base.sca82 \
        -activebackground #b97acf3cc22e -background #79e79e799658 \
        -bigincrement 0.0 -label Gain -orient horizontal -resolution 1.0 \
        -sliderlength 20 -tickinterval 0.0 -to 1000.0 \
        -troughcolor #befbcf3cc71b -variable Gain 
    bindtags $base.sca82 "Scale $base all $base.sca82"
    entry $base.ent83 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable Gain -width 48 
    button $base.but99 \
        -background #827a9a698d7c -command {set f1 [tk_getOpenFile]} \
        -disabledforeground #a1a4a1 -text {file 1} 
    entry $base.ent65 \
        -background #b97acf3cc22e -textvariable f1 
    button $base.but64 \
        -background #827a9a698d7c -command {set f2 [tk_getOpenFile]} \
        -disabledforeground #a1a4a1 -text {file 2} 
    entry $base.ent66 \
        -background #b97acf3cc22e -textvariable f2 
    button $base.but67 \
        -background #827a9a698d7c -command {set o [tk_getSaveFile]} \
        -disabledforeground #a1a4a1 -text outfile 
    entry $base.ent64 \
        -background #befbcf3cc71b -textvariable o 
    button $base.but65 \
        -activebackground #009999 -background #827a9a698d7c \
        -command {set cmd_line "xterm -e amber ";
if { $f1 !=""} {append cmd_line " -f1 $f1" }; 
if { $f2 !=""} {append cmd_line " -f2 $f2" } ;
if { $f3 !=""} {append cmd_line " -f3 $f3" } ;
if { $f4 !=""} {append cmd_line " -f4 $f4" } ;
if { $f5 !=""} {append cmd_line " -f5 $f5" } ;

append cmd_line " -o $o -fl $OutFileLength -ig $InitialGrainSize -fg $FinalGrainSize -id $InitialDensity -fd $FinalDensity -g $Gain -w $WindowSize"
if {$Morphing==0} {append cmd_line " -n $mse"} else {append cmd_line  " -ms $mse -me $mee"};
append cmd_line " -ps $InitialPan -pe $FinalPan -t $t &";
puts $cmd_line;
eval exec $cmd_line;} \
        -text start 
    entry $base.ent67 \
        -background #b97acf3cc22e -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable OutFileLength -width 54 
    scale $base.sca68 \
        -background #79e79e799658 -bigincrement 0.0 -from 1.0 \
        -label WindowSize -orient horizontal -resolution 1.0 -sliderlength 20 \
        -tickinterval 0.0 -troughcolor #befbcf3cc71b -variable WindowSize 
    bindtags $base.sca68 "Scale $base all $base.sca68"
    entry $base.ent69 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable WindowSize -width 48 
    checkbutton $base.che70 \
        -activebackground #79e79e799658 -background #79e79e799658 \
        -state normal -text Morphing -variable Morphing 
    ::iwidgets::checkbox $base.che65 \
        -background #79e79e799658 -labelpos n \
        -labeltext {MorphStartEnvelope } -selectcolor #990000 
    $base.che65 add chk0 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 1 -selectcolor #990000 \
        -text Gaussian -variable mse 
    $base.che65 add chk1 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 2 -selectcolor #990000 \
        -text Triangle -variable mse 
    $base.che65 add chk2 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 3 -selectcolor #990000 \
        -text Square -variable mse 
    $base.che65 add chk3 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 4 -selectcolor #990000 \
        -text Plateau -variable mse 
    $base.che65 add chk4 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 5 -selectcolor #990000 \
        -text {Simple Attack} -variable mse 
    $base.che65 add chk5 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 6 -selectcolor #990000 \
        -text Sine -variable mse 
    $base.che65 add chk6 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 7 -selectcolor #990000 \
        -text {Reverse attack} -variable mse 
    $base.che65 add chk7 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 8 -selectcolor #990000 \
        -text Hexagon -variable mse 
    $base.che65 add chk8 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 9 -selectcolor #990000 \
        -text M -variable mse 
    ::iwidgets::checkbox $base.che66 \
        -background #79e79e799658 -labelpos n -labeltext {MorphEnEnvelope } \
        -selectcolor #990000 
    $base.che66 add chk0 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 1 -selectcolor #990000 \
        -text Gaussian -variable mee 
    $base.che66 add chk1 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 2 -selectcolor #990000 \
        -text Triangle -variable mee 
    $base.che66 add chk2 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 3 -selectcolor #990000 \
        -text Square -variable mee 
    $base.che66 add chk3 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 4 -selectcolor #990000 \
        -text Plateau -variable mee 
    $base.che66 add chk4 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 5 -selectcolor #990000 \
        -text {Simple Attack} -variable mee 
    $base.che66 add chk5 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 6 -selectcolor #990000 \
        -text Sine -variable mee 
    $base.che66 add chk6 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 7 -selectcolor #990000 \
        -text {Reverse attack} -variable mee 
    $base.che66 add chk7 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 8 -selectcolor #990000 \
        -text Hexagon -variable mee 
    $base.che66 add chk8 \
        -anchor w -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightthickness 0 -justify left -onvalue 9 -selectcolor #990000 \
        -text M -variable mee 
    button $base.but66 \
        -background #827a9a698d7c -command {set f3 [tk_getOpenFile]} \
        -disabledforeground #a1a4a1 -text {file 3} 
    button $base.but68 \
        -background #827a9a698d7c -command {set f4 [tk_getOpenFile]} \
        -disabledforeground #a1a4a1 -text {file 4} 
    button $base.but69 \
        -background #827a9a698d7c -command {set f5 [tk_getOpenFile]} \
        -disabledforeground #a1a4a1 -text {file 5} 
    entry $base.ent68 \
        -background #b97acf3cc22e -textvariable f3 
    entry $base.ent70 \
        -background #b97acf3cc22e -textvariable f4 
    entry $base.ent71 \
        -background #b97acf3cc22e -textvariable f5 
    scale $base.sca73 \
        -background #79e79e799658 -bigincrement 0.0 -from -1.0 \
        -label InitialPan -orient horizontal -resolution 0.01 \
        -sliderlength 20 -tickinterval 0.0 -to 1.0 -troughcolor #befbcf3cc71b \
        -variable InitialPan 
    bindtags $base.sca73 "Scale $base all $base.sca73"
    entry $base.ent74 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable InitialPan -width 48 
    scale $base.sca75 \
        -background #79e79e799658 -bigincrement 0.0 -from -1.0 \
        -label FinalPan -orient horizontal -resolution 0.01 -sliderlength 20 \
        -tickinterval 0.0 -to 1.0 -troughcolor #befbcf3cc71b \
        -variable FinalPan 
    bindtags $base.sca75 "Scale $base all $base.sca75"
    entry $base.ent79 \
        -background #befbcf3cc71b -highlightbackground #009999 \
        -insertbackground black -relief groove -selectbackground #cccccc \
        -textvariable FinalPan -width 48 
    ::iwidgets::checkbox $base.che80 \
        -background #79e79e799658 -labeltext GrainGenType \
        -selectcolor #990000 
    $base.che80 add chk0 \
        -anchor w -background #79e79e799658 -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightbackground #79e79e799658 -highlightthickness 0 \
        -justify left -onvalue 1 -selectcolor #990000 -state normal \
        -text Standard -variable t 
    $base.che80 add chk1 \
        -anchor w -background #79e79e799658 -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightbackground #79e79e799658 -highlightthickness 0 \
        -justify left -onvalue 2 -selectcolor #990000 -state normal \
        -text Alternating -variable t 
    $base.che80 add chk2 \
        -anchor w -background #79e79e799658 -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightbackground #79e79e799658 -highlightthickness 0 \
        -justify left -onvalue 3 -selectcolor #990000 -state normal \
        -text Mixing -variable t 
    $base.che80 add chk3 \
        -anchor w -background #79e79e799658 -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightbackground #79e79e799658 -highlightthickness 0 \
        -justify left -onvalue 4 -selectcolor #990000 -state normal \
        -text Convolution -variable t 
    $base.che80 add chk4 \
        -anchor w -background #79e79e799658 -disabledforeground {} \
        -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
        -highlightbackground #79e79e799658 -highlightthickness 0 \
        -justify left -onvalue 5 -selectcolor #990000 -state normal \
        -text Fading -variable t 
    button $base.but81 \
        -background #827a9a698d7c \
        -command { if {$player==0} {set player "/usr/X11R6/bin/xplay"};
eval exec "$player $o"} \
        -text Listen! 
    button $base.but82 \
        -background #827a9a698d7c -command {set player [tk_getOpenFile]} \
        -font [vTcl:font:get_font "vTcl:font1"] -text {external player} \
        -textvariable ExtPlayer 
    entry $base.ent72 \
        -background #befbcf3cc71b -textvariable player 
    scale $base.sca74 \
        -activebackground #befbcf3cc71b -background #79e79e799658 \
        -bigincrement 0.0 -from 0.0 -label Filelength -orient horizontal \
        -resolution 0.1 -tickinterval 0.0 -to 100.0 \
        -troughcolor #befbcf3cc71b -variable OutFileLength 
    ###################
    # SETTING GEOMETRY
    ###################
    place $base.sca70 \
        -x 310 -y 10 -anchor nw -bordermode ignore 
    place $base.sca71 \
        -x 305 -y 65 -anchor nw 
    place $base.sca72 \
        -x 305 -y 125 -anchor nw 
    place $base.ent76 \
        -x 420 -y 105 -width 48 -height 22 -anchor nw -bordermode ignore 
    place $base.ent77 \
        -x 420 -y 45 -width 48 -height 22 -anchor nw -bordermode ignore 
    place $base.ent78 \
        -x 420 -y 160 -width 48 -height 22 -anchor nw -bordermode ignore 
    place $base.sca79 \
        -x 305 -y 185 -anchor nw 
    place $base.ent81 \
        -x 415 -y 220 -width 48 -height 22 -anchor nw 
    place $base.sca82 \
        -x 305 -y 245 -anchor nw 
    place $base.ent83 \
        -x 415 -y 275 -width 48 -anchor nw 
    place $base.but99 \
        -x 15 -y 25 -anchor nw -bordermode ignore 
    place $base.ent65 \
        -x 75 -y 30 -width 220 -anchor nw -bordermode ignore 
    place $base.but64 \
        -x 10 -y 60 -anchor nw 
    place $base.ent66 \
        -x 70 -y 65 -width 218 -height 22 -anchor nw 
    place $base.but67 \
        -x 10 -y 225 -anchor nw 
    place $base.ent64 \
        -x 80 -y 230 -width 218 -anchor nw 
    place $base.but65 \
        -x 660 -y 325 -width 108 -height 51 -anchor nw -bordermode ignore 
    place $base.ent67 \
        -x 245 -y 275 -width 40 -height 22 -anchor nw 
    place $base.sca68 \
        -x 470 -y 5 -anchor nw 
    place $base.ent69 \
        -x 580 -y 40 -width 48 -anchor nw 
    place $base.che70 \
        -x 825 -y 15 -anchor nw -bordermode ignore 
    place $base.che65 \
        -x 645 -y 50 -anchor nw -bordermode ignore 
    place $base.che66 \
        -x 815 -y 50 -anchor nw -bordermode ignore 
    place $base.but66 \
        -x 10 -y 100 -anchor nw 
    place $base.but68 \
        -x 10 -y 140 -anchor nw 
    place $base.but69 \
        -x 10 -y 180 -anchor nw 
    place $base.ent68 \
        -x 70 -y 105 -width 218 -height 22 -anchor nw 
    place $base.ent70 \
        -x 70 -y 145 -width 218 -height 22 -anchor nw 
    place $base.ent71 \
        -x 70 -y 185 -width 218 -height 22 -anchor nw 
    place $base.sca73 \
        -x 470 -y 65 -anchor nw 
    place $base.ent74 \
        -x 580 -y 95 -width 48 -anchor nw 
    place $base.sca75 \
        -x 470 -y 125 -anchor nw 
    place $base.ent79 \
        -x 580 -y 155 -width 48 -anchor nw 
    place $base.che80 \
        -x 470 -y 200 -anchor nw -bordermode ignore 
    place $base.but81 \
        -x 775 -y 325 -width 109 -height 51 -anchor nw -bordermode ignore 
    place $base.but82 \
        -x 15 -y 355 -anchor nw -bordermode ignore 
    place $base.ent72 \
        -x 130 -y 355 -width 218 -height 22 -anchor nw 
    place $base.sca74 \
        -x 20 -y 270 -width 216 -height 58 -anchor nw -bordermode ignore 

    vTcl:FireEvent $base <<Ready>>
}

#############################################################################
## Binding tag:  _TopLevel

bind "_TopLevel" <<Create>> {
    if {![info exists _topcount]} {set _topcount 0}; incr _topcount
}
bind "_TopLevel" <<DeleteWindow>> {
    destroy %W; if {$_topcount == 0} {exit}
}
bind "_TopLevel" <Destroy> {
    if {[winfo toplevel %W] == "%W"} {incr _topcount -1}
}

Window show .
Window show .top64

main $argc $argv

