#! ../mofe --f
mergeResources topLevel *background gray75

mMainWindow main topLevel

  mMenuBar menu_bar main
    mPulldownMenu mp1 menu_bar unmanaged
      mPushButton Quit mp1 \
	activateCallback quit
    mCascadeButton Actions menu_bar \
	subMenuId mp1

    mPulldownMenu mp2 menu_bar unmanaged
      mPushButton Help mp2 \
	activateCallback "manageChild helpbox"
      mPushButton Version mp2 \
	activateCallback "manageChild versionbox"
    mCascadeButton Help menu_bar \
	subMenuId mp2

  mFileSelectionBox fsbox main \
	okCallback "do_ok %s" \
 	dirListLabelString Main 

mMessageDialog versionbox Version unmanaged \
	dialogTitle "Motif Filetimes Version" \
	okLabelString "Close" \
	messageString "@(#)filetimes Version A.00.15, Sep 30 21:05:17 MET 1992"

mMessageDialog helpbox Help unmanaged \
	dialogTitle "Filetimes Help" \
	okLabelString "Close" \
	messageString "\
The FileSelectionBox displays files in the current directory.  You \n\
select a file by moving the pointer to that file name and clicking mouse \n\
button 1.  Then move the pointer to the `ok' button and click mouse \n\
button 1 again.  A message box will appear with the last file access time, \n\
the last file modification time, and the last file change time.  Note \n\
that writing to a file changes both modification time and change time. \n\
See the man page for stat (2) and ctime (3C) for more information."

mMessageDialog messagebox fsbox unmanaged \
	dialogTitle "File Times" \
	labelFontList -b&h-*-medium-r-*-*-*-140-*-*-m-*-iso8859-* \
	okLabelString "Close" 

proc do_ok {file} { 
	if [file exists $file] then {file lstat $file stat;
	   sV messagebox messageString "\
Last access Time        = [ctime $stat(atime)]\n\
Last modification Time  = [ctime $stat(mtime)]\n\
Last change Time        = [ctime $stat(ctime)]"} else {
           sV messagebox MessageString "Invalid file or directroy"};
        manageChild messagebox}

unmanageChild \
	fsbox.[mFileSelectionBoxGetChild fsbox DIALOG_CANCEL_BUTTON] \
	fsbox.[mFileSelectionBoxGetChild fsbox DIALOG_HELP_BUTTON] \
	versionbox.[mMessageBoxGetChild versionbox DIALOG_CANCEL_BUTTON] \
	versionbox.[mMessageBoxGetChild versionbox DIALOG_HELP_BUTTON] \
	helpbox.[mMessageBoxGetChild helpbox DIALOG_CANCEL_BUTTON] \
	helpbox.[mMessageBoxGetChild helpbox DIALOG_HELP_BUTTON] \
	messagebox.[mMessageBoxGetChild messagebox DIALOG_CANCEL_BUTTON] \
	messagebox.[mMessageBoxGetChild messagebox DIALOG_HELP_BUTTON]

mMainWindowSetAreas main menu_bar NULL NULL NULL fsbox
sV menu_bar menuHelpWidget Help
realize

