{- |
  Called whenever the button "Display" is clicked.
-}
doDisplayGoals :: ProofState -> IO ()
doDisplayGoals s =
    case currentTheory s of
      G_theory lid1 _ (ExtSign sig1 _) _ sens1 _ -> do
       let thName = theoryName s
           goalsText = show . Pretty.vsep .
                          map (print_named lid1 .
                               AS_Anno.mapNamed (simplify_sen lid1 sig1))
                          . toNamedList
                          $ filterMapWithList (selectedGoals s) sens1
       createTextSaveDisplay ("Selected Goals from Theory " ++ thName)
                          (thName ++ "-goals.txt") goalsText

{- |
  Called whenever a prover is selected from the "Pick Theorem Prover" ListBox.
-}
doDisplayGoals :: ProofState -> IO ()
doDisplayGoals s =
    case currentTheory s of
      G_theory lid1 _ (ExtSign sig1 _) _ sens1 _ -> do
       let thName = theoryName s
           goalsText = show . Pretty.vsep .
                          map (print_named lid1 .
                               AS_Anno.mapNamed (simplify_sen lid1 sig1))
                          . toNamedList
                          $ filterMapWithList (selectedGoals s) sens1
       createTextSaveDisplay ("Selected Goals from Theory " ++ thName)
                          (thName ++ "-goals.txt") goalsText

{- |
  Called whenever a prover is selected from the "Pick Theorem Prover" ListBox.
-}
doDisplayGoals s =
    case currentTheory s of
      G_theory lid1 _ (ExtSign sig1 _) _ sens1 _ -> do
       let thName = theoryName s
           goalsText = show . Pretty.vsep .
                          map (print_named lid1 .
                               AS_Anno.mapNamed (simplify_sen lid1 sig1))
                          . toNamedList
                          $ filterMapWithList (selectedGoals s) sens1
       createTextSaveDisplay ("Selected Goals from Theory " ++ thName)
                          (thName ++ "-goals.txt") goalsText

{- |
  Called whenever a prover is selected from the "Pick Theorem Prover" ListBox.
-}