CurryInfo: sourceproggui-3.0.0 / SourceProgGUI.sourceProgGUI

definition:
sourceProgGUI :: String -> [(String,(Int,Int))]
             -> (Widget,[Handle -> GuiPort -> IO [ReconfigureItem]])
sourceProgGUI cnt progdefs =
 (col [row [Label [Text "Focus on function:"],
            Entry [WRef rinp, Background "yellow", FillX]
           ],
       TextEditScroll [WRef ptxt, Text cnt, Background "white",
                       Height 10, Width 70, Fill]],
  [extHandler])

 where
   ptxt,rinp free

   extHandler :: Handle -> GuiPort -> IO [ReconfigureItem]
   extHandler h gp = do
     inp <- hGetLine h
     if null inp || head inp == 'q'
      then exitGUI gp
      else maybe (return ())
                 (\ (start,end) ->
                   if head inp == '+'
                   then do
                     setValue rinp (tail inp) gp
                     addRegionStyle ptxt (start,0) (end+1,0) (Bg Yellow) gp
                     seeText ptxt ((start+end) `div` 2,0) gp
                   else do
                     removeRegionStyle ptxt (start,0) (end+1,0) (Bg Yellow) gp
                     setValue rinp "" gp
                     extHandler h gp >> return ()
                 )
                (lookup (tail inp) progdefs)
     return []
demand:
no demanded arguments
deterministic:
possibly non-deterministic operation
documentation:
---------------------------------------------------------------------
-- The definition of the GUI together with a handler
-- "extHandler" that is responsible to handle the external input:
failfree:
<FAILING>
indeterministic:
might be indeterministic
infix:
no fixity defined
iotype:
{(_,_) |-> {(,)}}
name:
sourceProgGUI
precedence:
no precedence defined
result-values:
{(,)}
signature:
String -> [(String, (Prelude.Int, Prelude.Int))]
-> (Graphics.UI.Widget, [System.IO.Handle -> Graphics.UI.GuiPort
-> Prelude.IO [Graphics.UI.ReconfigureItem]])
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term