Next Previous Up Top Contents Index

5.3 DUIM-Sheets Module

choose-directory

Generic function

Summary

Displays the built-in directory dialog for the target platform.

Signature

choose-directory #key frame owner title documentation exit-boxes name default => locator

Arguments

frame
An instance of type <frame>. Default value: #f.

owner
An instance of type <sheet>. Default value: #f.

title
An instance of type <string>.

documentation
An instance of type <string>.

exit-boxes
An instance of type <object>.

name
An instance of type <object>.

default
An instance of type <object>.

Values

locator
An instance of type type-union(<string>, <locator>).

Library

duim-sheets

Module

duim-sheets

Description

Displays the built-in directory dialog for the target platform, which allows the user to choose a directory from any of the local or networked drives currently connected to the computer.

If the frame argument is specified, the top-level sheet of frame becomes the owner of the dialog.

Alternatively, you can specify the owner directly using the owner argument, which takes an instance of <sheet> as its value.

By default, both frame and owner are #f, meaning the dialog has no owner. You should not specify both of these values.

If you wish, you can specify a title for the dialog; this is displayed in the title bar of the frame containing the dialog.

Example

The following example illustrates how you can define a class of frame that contains a button that displays the Choose Directory dialog, using the pre-built dialog classes for your target environment.

define frame <directory-dialog-frame> (<simple-frame>)
  pane dir-file-button (frame)
    make(<menu-button>,
         label: "Choose directory ...",
         documentation: 
          "Example of standard 'Choose Dir' dialog",
         activate-callback: 
          method (button)
          let dir = choose-directory (owner: frame);
            if (dir) frame-status-message(frame)
             := format-to-string
                  ("Chose directory %s", dir);
            end
          end);
  pane dir-layout (frame)
    vertically ()
      frame.dir-file-button;
    end;
  layout (frame) frame.dir-layout;
  keyword title: = "Choose directory example";
end frame <directory-dialog-frame>;

See also

choose-color, page 220

choose-file, page 224

notify-user, page 315


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index