4 The stddialogs Library

This fragment contains a few standard dialogs (more will be added later):

4.1 Using the stddialogs Library

Remember that in order to utilize this extension to Lidskjalv, the fragment stddialogs must be included as follows:

ORIGIN '~beta/guienv/guienv';
INCLUDE '~beta/guienv/stddialogs'
--- program: descriptor ---
guienv(# ...
      do ...
         ... -> fileSelectionDialog -> ...;
         ...
      #)

4.2 Examples of Use of the stddialogs Fragment

This demo program illustrates the use of the standard file selection dialog. The name of the file selected in the dialog is printed on the screen.

Program 3: file.bet

ORIGIN '~beta/guienv/guienv';
INCLUDE '~beta/guienv/stddialogs';
(* This demo shows how to use the fileSelectionDialog pattern.  The
 * name of the file selected in the dialog is printed on the screen.
 *)
-- program: descriptor --
guienv
(# theWindow: @window
     (# eventHandler::
          (# onAboutToClose:: (# do terminate #);
             onMouseUp::
               (# name: ^text;
               do theWindow[] -> fileSelectionDialog -> name[];
                  (if name[]=NONE then
                      'Selected Cancel' -> putline
                   else
                      name[] -> putline
                  if)
               #)
          #)
     #)
do theWindow.open
#)
[35kb 303x400 GIF]


Lidskjalv: User Interface Framework - Reference Manual
© 1994-2004 Mjølner Informatics
[Modified: Friday October 27th 2000 at 14:56]