head	1.5;
access;
symbols
	core-8-5-9:1.5
	core-8-5-8:1.5
	macosx-cocoa-merge:1.5
	macosx-cocoa-premerge:1.5
	macosx-carbon-freeze:1.5
	core-8-5-7:1.5
	core-8-5-6:1.5
	core-8-6-b1:1.5
	core-8-6-a3:1.5
	core-8-5-5:1.5
	core-8-6-a2:1.5
	core-8-5-4:1.5
	core-8-5-3:1.5
	core-8-6-a1:1.5
	core-8-4-19:1.4
	core-8-5-branch:1.5.0.6
	core-8-5-2:1.5
	core-8-4-18:1.4
	core-8-5-1:1.5
	core-8-4-17:1.4
	core-8-5-0:1.5
	core-8-5-b3:1.5
	core-8-5-b2:1.5
	core-8-4-16:1.4
	core-8-5-b1:1.5
	core-stablilizer-merge:1.5
	core-stabilizer-branch:1.5.0.4
	core-stabilizer-merge:1.5
	core-8-4-15:1.4
	core-8-5-a6:1.5
	core-8-5-a5:1.5
	core-8-4-14:1.4
	core-8-5-a4:1.5
	core-8-4-13:1.4
	core-8-4-12:1.4
	core-8-4-11:1.4
	core-8-5-a3:1.5
	core-8-4-10:1.4
	core-8-4-9-branch:1.4.0.4
	core-8-5-a2:1.5
	core-8-4-9:1.4
	core-8-4-8:1.4
	core-8-4-7:1.4
	core-8-5-a1:1.5
	core-8-4-6:1.4
	core-8-4-5:1.4
	mistachkin-dev-branch:1.5.0.2
	core-8-4-4:1.4
	core-8-4-3:1.4
	core-8-4-branch:1.4.0.2
	core-8-4-2:1.4
	core-8-4-1:1.4
	core-8-3-5:1.2.18.1
	core-8-4-0:1.4
	macosx-8-4-merge-2002-08-31-trunk:1.4
	macosx-8-4-premerge-2002-08-31-branch:1.2.24.1
	macosx-8-4-premerge-2002-08-31-trunk:1.4
	macosx-8-4-merge-2002-08-30-branch:1.2.24.1
	macosx-8-4-merge-2002-08-30-trunk:1.4
	macosx-8-4-merge-2002-08-20-branch:1.2.24.1
	macosx-8-4-merge-2002-08-20-trunk:1.4
	core-8-4-b2:1.4
	core-8-4-b1:1.4
	macosx-premerge-6-9-02:1.2.24.1
	core-8-4-a4:1.4
	core-8-3-4:1.2.18.1
	macosx-8-4-branch:1.2.0.24
	macosx-8-4-branchpoint:1.2
	core-8-4-a3:1.2
	core-8-3-3:1.2
	dgp-privates-into-namespace:1.2.0.22
	tclpro-1-5-0:1.2
	core-8-4-win-speedup:1.2.0.20
	core-8-4-a2:1.2
	tclpro-1-4-1:1.2
	tclpro-1-4-0:1.2
	core-8-3-2:1.2
	ajuba-ajuba2-2-1-base:1.2
	ajuba-ajuba2-2-0:1.2
	core-8-4-a1:1.2
	core-8-3-1-branch:1.2.0.18
	core-8-3-1:1.2
	scriptics-sc-2-0-b5:1.2
	scriptics-sc-2-0-fixed:1.2
	scriptics-sc-2-0-b2:1.2
	scriptics-sc-2-0-b1:1.2
	core-8-3-0:1.2
	core-8-3-b2:1.2
	core-8-3-b1:1.2
	scriptics-sc-1-1:1.2
	scriptics-sc-1-1-b1:1.2
	core-8-2-3:1.2
	scriptics-sc-1-1-branch:1.2.0.16
	scriptics-sc-1-1-base:1.2
	scriptics-sc-1-0:1.2
	scriptics-sc-1-0-branch:1.2.0.14
	scriptics-sc-1-0-base:1.2
	core-8-2-2:1.2
	core-8-2-1:1.2
	scriptics-bc-1-0-b1:1.2
	core-8-2-1-branch:1.2.0.12
	scriptics-tclpro-1-3-0:1.2
	core-8-2-0:1.2
	core-8-2-b3-branch:1.2.0.10
	core-8-2-b3-base:1.2
	scriptics-tclpro-1-3-b4:1.2
	core-8-2-b2:1.2
	scriptics-tclpro-1-3-b3:1.2
	core-8-2-b1:1.2
	scriptics-tclpro-1-3-b2:1.2
	merge-to-mainline-5/21/99:1.2
	scriptics-tclpro-1-3-b2-branch:1.2.0.8
	core-8-1-1:1.2
	scriptics-tclpro-1-3-b1:1.2
	core-8-1-1-base:1.2
	core-8-1-0:1.2
	merge-to-mainline-4-29-99:1.2
	merge-to-mainline-4-23-99:1.2
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.1
	core-8-1-b2:1.1.4.1
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.5
date	2003.09.30.14.54.29;	author dkf;	state Exp;
branches;
next	1.4;

1.4
date	2001.11.05.10.13.53;	author dkf;	state Exp;
branches;
next	1.3;

1.3
date	2001.10.29.16.42.20;	author dkf;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.23.27;	author stanton;	state Exp;
branches
	1.2.18.1
	1.2.20.1
	1.2.24.1;
next	1.1;

1.1
date	98.04.01.09.54.29;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.17.41;	author stanton;	state Exp;
branches;
next	;

1.2.18.1
date	2001.10.12.10.56.13;	author dkf;	state Exp;
branches;
next	;

1.2.20.1
date	2002.04.02.20.58.50;	author hobbs;	state Exp;
branches;
next	;

1.2.24.1
date	2002.02.05.02.25.16;	author wolfsuit;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Added [package require] to demos. [FRQ 815118]
@
text
@#!/bin/sh
# the next line restarts using wish \
exec wish "$0" ${1+"$@@"}

# browse --
# This script generates a directory browser, which lists the working
# directory and allows you to open files or subdirectories by
# double-clicking.
#
# RCS: @@(#) $Id: browse,v 1.4 2001/11/05 10:13:53 dkf Exp $

package require Tk

# Create a scrollbar on the right side of the main window and a listbox
# on the left side.

scrollbar .scroll -command ".list yview"
pack .scroll -side right -fill y
listbox .list -yscroll ".scroll set" -relief sunken -width 20 -height 20 \
	-setgrid yes
pack .list -side left -fill both -expand yes
wm minsize . 1 1

# The procedure below is invoked to open a browser on a given file;  if the
# file is a directory then another instance of this program is invoked; if
# the file is a regular file then the Mx editor is invoked to display
# the file.

set browseScript [file join [pwd] $argv0]
proc browse {dir file} {
    global env browseScript
    if {[string compare $dir "."] != 0} {set file $dir/$file}
    switch [file type $file] {
	directory {
	    exec [info nameofexecutable] $browseScript $file &
	}
	file {
	    if {[info exists env(EDITOR)]} {
		eval exec $env(EDITOR) $file &
	    } else {
		exec xedit $file &
	    }
	}
	default {
	    puts stdout "\"$file\" isn't a directory or regular file"
	}
    }
}

# Fill the listbox with a list of all the files in the directory.

if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."}
foreach i [lsort [glob * .* *.*]] {
    if {[file type $i] eq "directory"} {
	# Safe to do since it is still a directory.
	append i /
    }
    .list insert end $i
}

# Set up bindings for the browser.

bind all <Control-c> {destroy .}
bind .list <Double-Button-1> {foreach i [selection get] {browse $dir $i}}

# Local Variables:
# mode: tcl
# End:
@


1.4
log
@Minor fixes from wohnivec@@iol.cz  Thanks!
@
text
@d10 3
a12 1
# RCS: @@(#) $Id: browse,v 1.3 2001/10/29 16:42:20 dkf Exp $
@


1.3
log
@More demo upgrades derived from 8.3.4
@
text
@d3 1
a3 1
exec wish8.4 "$0" ${1+"$@@"} || exec wish "$0" ${1+"$@@"}
d10 1
a10 1
# RCS: @@(#) $Id: browse,v 1.2 1998/09/14 18:23:27 stanton Exp $
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d3 1
a3 1
exec wish "$0" "$@@"
d10 1
a10 1
# RCS: @@(#) $Id$
d27 1
d29 1
a29 1
    global env
d31 6
a36 5
    if [file isdirectory $file] {
	exec browse $file &
    } else {
	if [file isfile $file] {
	    if [info exists env(EDITOR)] {
d41 2
a42 1
	} else {
d48 1
a48 2
# Fill the listbox with a list of all the files in the directory (run
# the "ls" command to get that information).
d50 6
a55 2
if $argc>0 {set dir [lindex $argv 0]} else {set dir "."}
foreach i [exec ls -a $dir] {
d63 4
@


1.2.20.1
log
@sync with head
@
text
@d3 1
a3 1
exec wish "$0" ${1+"$@@"}
d10 1
a10 1
# RCS: @@(#) $Id: browse,v 1.4 2001/11/05 10:13:53 dkf Exp $
a26 1
set browseScript [file join [pwd] $argv0]
d28 1
a28 1
    global env browseScript
d30 5
a34 6
    switch [file type $file] {
	directory {
	    exec [info nameofexecutable] $browseScript $file &
	}
	file {
	    if {[info exists env(EDITOR)]} {
d39 1
a39 2
	}
	default {
d45 2
a46 1
# Fill the listbox with a list of all the files in the directory.
d48 2
a49 6
if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."}
foreach i [lsort [glob * .* *.*]] {
    if {[file type $i] eq "directory"} {
	# Safe to do since it is still a directory.
	append i /
    }
a56 4

# Local Variables:
# mode: tcl
# End:
@


1.2.24.1
log
@Merge with current TOT
Added support for the wm stackorder command
Fixed crash when selecting Menu items in the Application menu that we didn't
put there.
Added first bits of the use of CG for low-level drawing.  The line-drawing works,
the rest doesn't yet.  You have to set the file static useCGDrawing to 1 and
rebuild to activate this code.
@
text
@d3 1
a3 1
exec wish "$0" ${1+"$@@"}
d10 1
a10 1
# RCS: @@(#) $Id: browse,v 1.2 1998/09/14 18:23:27 stanton Exp $
a26 1
set browseScript [file join [pwd] $argv0]
d28 1
a28 1
    global env browseScript
d30 5
a34 6
    switch [file type $file] {
	directory {
	    exec [info nameofexecutable] $browseScript $file &
	}
	file {
	    if {[info exists env(EDITOR)]} {
d39 1
a39 2
	}
	default {
d45 2
a46 1
# Fill the listbox with a list of all the files in the directory.
d48 2
a49 6
if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."}
foreach i [lsort [glob * .* *.*]] {
    if {[file type $i] eq "directory"} {
	# Safe to do since it is still a directory.
	append i /
    }
a56 4

# Local Variables:
# mode: tcl
# End:
@


1.2.18.1
log
@Updates to demos
@
text
@d10 1
a10 1
# RCS: @@(#) $Id: browse,v 1.2 1998/09/14 18:23:27 stanton Exp $
a26 1
set browseScript [file join [pwd] $argv0]
d28 1
a28 1
    global env browseScript
d31 1
a31 1
	exec [info nameofexecutable] $browseScript $file &
d45 2
a46 1
# Fill the listbox with a list of all the files in the directory.
d49 1
a49 7
foreach i [lsort [glob * .* *.*]] {
    switch [file type $i] {
	directory {
	    # Safe to do since it is still a directory.
	    append i /
	}
    }
a56 4

# Local Variables:
# mode: tcl
# End:
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
# SCCS: @@(#) browse 1.8 96/02/16 10:49:18
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d10 1
a10 1
# RCS: @@(#) $Id: browse,v 1.2 1998/09/14 18:23:27 stanton Exp $
@


