home *** CD-ROM | disk | FTP | other *** search
- # SpecTcl, by S. A. Uhler
- # Copyright (c) 1994-1995 Sun Microsystems, Inc.
- #
- # See the file "license.txt" for information on usage and redistribution
- # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- #
- # interface generated from open.ui
- # root is the parent window for this user interface
-
- proc open_ui {root args} {
-
- # this treats "." as a special case
-
- if {$root == "."} {
- set base ""
- } else {
- set base $root
- }
-
- frame $base.frame#1
-
- label $base.label#1 \
- -text {Open Project}
- catch {
- $base.label#1 configure \
- -font -*-Helvetica-Bold-R-Normal--*-160-*-*-*-*-*-*
- }
-
- entry $base.entry \
- -textvariable entry
-
- listbox $base.listbox \
- -height 0 \
- -width 0 \
- -yscrollcommand "$base.scrollbar#1 set"
-
- scrollbar $base.scrollbar#1 \
- -command "$base.listbox yview" \
- -orient v
-
- button $base.ok \
- -command "load_project \[$base.entry get\].\$P(file_suffix); destroy $root" \
- -padx 11 \
- -pady 4 \
- -text OK
-
- button $base.button#2 \
- -command "destroy $root" \
- -padx 11 \
- -pady 4 \
- -text Cancel
-
-
- # Geometry management
-
- blt_table $root $base.frame#1 3,3
- blt_table $root $base.label#1 1,1 \
- -columnspan 3
- blt_table $root $base.entry 2,1 \
- -fill x
- blt_table $root $base.listbox 3,1 \
- -fill both
- blt_table $root $base.scrollbar#1 3,2 \
- -fill y
- blt_table $base.frame#1 $base.ok 1,1 \
- -fill both
- blt_table $base.frame#1 $base.button#2 3,1 \
- -fill both
-
- # Resize behavior management
-
- blt_table row $root configure all -resize none
- blt_table row $root configure 3 -resize both
- blt_table row $root configure 1 -height {30 Inf}
- blt_table row $root configure 2 -height {30 Inf}
- blt_table row $root configure 3 -height {148 Inf}
- blt_table column $root configure all -resize none
- blt_table column $root configure 1 -resize both
- blt_table column $root configure 1 -width {136 Inf}
- blt_table column $root configure 2 -width {30 Inf}
- blt_table column $root configure 3 -width {30 Inf}
-
- blt_table row $base.frame#1 configure all -resize none
- blt_table row $base.frame#1 configure 1 -height {30 Inf}
- blt_table row $base.frame#1 configure 2 -height {30 Inf}
- blt_table row $base.frame#1 configure 3 -height {30 Inf}
- blt_table column $base.frame#1 configure all -resize none
- blt_table column $base.frame#1 configure 1 -width {30 Inf}
- # additional interface code
- bind $base.entry <Return> "$base.ok invoke"
- bind $base.listbox <1> {
- [winfo parent %W].entry delete 0 end
- [winfo parent %W].entry insert 0 [%W get [%W nearest %y]]
- }
-
- bind $base.listbox <Return> {
- [winfo parent %W].entry delete 0 end
- [winfo parent %W].entry insert 0 [%W get [%W curselection]]
- [winfo parent %W].ok invoke
- }
-
- bind $base.listbox <Double-1> "$base.ok invoke; break"
-
- # fill the list box
-
- set files ""
- regsub -all {\.ui } "[glob -nocomplain *.ui] " { } files
- eval $base.listbox insert 0 [lsort $files]
-
-
-
-
-
-
- # end additional interface code
-
- }
-