#!/usr/local/bin/wish
# interface generated by SpecTcl version 1.1 from C:/Program Files/SpecTcl1.1/demo/getText.ui
#   root     is the parent window for this user interface
source getTextEntry.ui.tcl
proc getText_ui {root args} {

	# this treats "." as a special case

	if {$root == "."} {
	    set base ""
	} else {
	    set base $root
	}
    
	frame $base.frame#2 \
		-borderwidth 2 \
		-relief groove

	frame $base.frame#1

	label $base.label#1 \
		-background red \
		-foreground white \
		-text {Plot Text?}

	radiobutton $base.radiobutton#1 \
		-text yes \
		-value yes \
		-variable text_plot

	radiobutton $base.radiobutton#2 \
		-text no \
		-value no \
		-variable text_plot

	label $base.label#2 \
		-text {How many?}

	entry $base.entryN_text \
		-textvariable n_text \
		-width 2

	button $base.button#1 \
		-background magenta \
		-borderwidth 4 \
                -command "toplevel .get_TextEntry; focus .get_TextEntry; \
                          getTextEntry_ui .get_TextEntry; \
                          grab .get_TextEntry; \
                          tkwait window .get_TextEntry" \
		-text {enter text}

	button $base.button#2 \
		-background green \
		-borderwidth 4 \
		-text enter


	# Geometry management

	grid $base.frame#2 -in $root	-row 2 -column 1 
	grid $base.frame#1 -in $root	-row 1 -column 1 
	grid $base.label#1 -in $base.frame#1	-row 1 -column 1 
	grid $base.radiobutton#1 -in $base.frame#1	-row 1 -column 2 
	grid $base.radiobutton#2 -in $base.frame#1	-row 1 -column 3 
	grid $base.label#2 -in $base.frame#2	-row 1 -column 1 
	grid $base.entryN_text -in $base.frame#2	-row 1 -column 2 
	grid $base.button#1 -in $base.frame#2	-row 1 -column 3  \
		-padx 10 \
		-pady 5
	grid $base.button#2 -in $root	-row 3 -column 1  \
		-pady 10

	# Resize behavior management

	grid rowconfigure $base.frame#2 1 -weight 0 -minsize 30
	grid columnconfigure $base.frame#2 1 -weight 0 -minsize 30
	grid columnconfigure $base.frame#2 2 -weight 0 -minsize 30
	grid columnconfigure $base.frame#2 3 -weight 0 -minsize 30

	grid rowconfigure $root 1 -weight 0 -minsize 30
	grid rowconfigure $root 2 -weight 0 -minsize 30
	grid rowconfigure $root 3 -weight 0 -minsize 30
	grid columnconfigure $root 1 -weight 0 -minsize 30

	grid rowconfigure $base.frame#1 1 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 1 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 2 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 3 -weight 0 -minsize 30
# additional interface code
# end additional interface code

}


# Allow interface to be run "stand-alone" for testing

catch {
    if [info exists embed_args] {
	# we are running in the plugin
	getText_ui .
    } else {
	# we are running in stand-alone mode
	if {$argv0 == [info script]} {
	    wm title . "Get Text"
	    getText_ui .
	}
    }
}
