Sunviews "file selector" widget, help!

David Kirkpatrick davidk at pvi.UUCP
Fri May 12 15:33:14 AEST 1989


I am trying to implement a "File Selection" widget under SunViews, similar
to the blocking dialog boxes found on the Macintosh when one selects
"Open..." or "Save As..." from a pulldown menu.

Below is a rough sketch of the widget I have in mind.  The two text fields
would indicate the current directory and the currently highlighted file,
repectively.  When the cursor is over a filename on the left, then the
rectangle surrounding the filename would be highlighted in reverse video,
similar to the behaviour found in the sunviews Menu package.  (This is
indicated by the rectangle around the file "filename3.c").  Getting this
highlight effect seems to be the tricky part.  The other nifty thing is
the scrollbar to the right of the files that would allow you to scroll
through groups of files whenever you are selecting from a directory with
many files.


        ------------------------------------------------------
        |Current Path: /10/usr10/davidk                      |
        |                                                    |
        |Current File: filename3.c                           | 
        |                                                    |
        |-------------------------------|-|                  |
        |  filename1.c                  |^|                  |
        |                               |-|                  |
        |  filename2.c                  | |                  |
        |-------------------------------| |                  |
        |  filename3.c                  | |   |----------|   |
        |-------------------------------| |   |    OK    |   |
        |  filename4.c                  | |   |----------|   |
        |                               | |                  |
        |  filename5.c                  | |   |----------|   |
        |                               |-|   |  CANCEL  |   |
        |  filename6.c                  |v|   |----------|   |
        |-------------------------------|-|                  |
        ------------------------------------------------------



The problem I am facing is that I want to attach conflicting features to the
widget.  The only way I know how to get the highlighting effect is to use
a menu (that always stays up!), however I don't know that a scrollbar can
be attached to an individual widget.  I think a scrollbar needs a window to
attach itself, thus the above window will probably be at least two panels
inside a frame.

If anyone has any hints, suggestions, or code that implements this
functionality, please let me know.

Thanks,

David Kirkpatrick

Please respond to:
{boulder, ncar}!pvi.com!davidk           (UUCP)
{boulder, ncar}!davidk at pvi.com           (INTERNET)

or call:   (303) 530-9000



More information about the Comp.sys.sun mailing list