
#-------------------------------------------------------------------------------
# Module:     fileChanges.tk
# Activation: Dynamically loaded on user request
# Scope:      Prompt for saving or discarding current object
#-------------------------------------------------------------------------------



global ChangeOptions

if {$Unchanged==1 || $ChangeOptions==2} {
    eval $PromptCommand
    return
}

if {$ChangeOptions==0} {
    SaveFile
    eval $PromptCommand
    return
}

destroy .saveChanges
toplevel .saveChanges
wm title .saveChanges "GOBLET Prompt"
wm resizable .saveChanges 0 0
grab set .saveChanges

global FileName
     
frame .saveChanges.buttons
    button .saveChanges.buttons.cancel -text "Cancel" -command { \
        destroy .saveChanges
    }
    
    button .saveChanges.buttons.proceed -text "No" -command { \
        destroy .saveChanges
        eval $PromptCommand
    }
    
    button .saveChanges.buttons.save -text "Yes" -command { \
        SaveFile
        destroy .saveChanges
        eval $PromptCommand
    }
    
    pack .saveChanges.buttons.save .saveChanges.buttons.proceed \
         .saveChanges.buttons.cancel -side left -fill x -padx 3m
     
pack .saveChanges.buttons -padx 3m -pady 3m -side bottom
    
frame .saveChanges.frame
pack .saveChanges.frame -padx 4m -pady 3m -side top -anchor w
    
label .saveChanges.frame.warn -image msg_warn
message .saveChanges.frame.msg -width 10c \
    -text "Save changes to [file tail $FileName]?"
pack .saveChanges.frame.warn .saveChanges.frame.msg -padx 2m -side left


        
