Re: nice file opening window

From: Andrew Dorrell <>
Date: Sat, 13 Jun 1998 16:12:29 +0200

Sarah Calvo wrote:
> > Can anybody point me to a good file opening window (object?) in STk, an
> > extension, or, hopefully, an STklos extension? My application currently
> > uses a primitive file-opening window w/listbox that I built myself,...

There are a couple on kaolin in the public contributions.

For my part, I have attached another one which I have written. It
uses two listboxes, one for directories, one for files, has a Mac
style parent directory pulldown, supports typed filename entry with a
limited form of filename completion (using tab key). I should note
that the listboxes are updated correctly when using the backspace key
as well. Multiple file selection modes are supported (aka single,
multiple, extended). There is a hidden files check button and a
choice entry field into which you can add filename filters. Filters
can be set up by the application programmer (with entry field
disabled) or a filter spec can be typed in. Hitting enter
subsequently applies the filter and adds it to the list of available
filters on the puldown (choice) menu.

The code is written with the intension that the file selector is a
separate class which can be created and packed into a window with
other widgets as required. This meant however that you had to do some
work to get a file box up so I took the liberty of writing a function
(make-file-box . args) suitable for use as a plug in replacement for
the existing STk filebox. The args lets you do neat initialisation
things such as:

(make-file-box :title "Open input file"
                :transient-for my-toplevel-window
                :directory "~/images")


(make-file-box :select-mode 'extended)

Unique to this widget is the ability to specify (via scheme functions)
how files and directories are found. This is a more esoteric feature
which allows navigation of non-file hierarchical structures using the
widget. (This was the feature I needed...)

Caveats: I have not been as nice about namespace as I perhaps should

I have tried it out a bit and it seems solid. Hope it can be of use
to others. Appologies for it being in 4 separate files... have tared
and gziped. Also for posting - I was unable to upload to Incoming
directory on kaloin.

Mr Andrew Dorrell                                *
Faculty of Engineering             /---\  Whoo?      *
University of Technology, Sydney   (o o) /     *
AUSTRALIA                          ( : )            .

Received on Tue Jun 16 1998 - 09:45:33 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST