definition: |
getCursorPosition :: WidgetRef -> GuiPort -> IO (Int,Int) getCursorPosition (WRefLabel var wtype) gport = if wtype/="textedit" then error ("GUI.getCursorPosition not applicable to widget type \""++ wtype++"\"") else do send2tk ("puts [ "++wRefname2Label var++" index insert ]") gport line <- receiveFromTk gport let (ls,ps) = break (=='.') line return (if null ps then (0,0) else (read ls, read (tail ps))) |
demand: |
argument 1 |
deterministic: |
deterministic operation |
documentation: |
--- Get the position (line,column) of the insertion cursor in a TextEdit --- widget. Lines are numbered from 1 and columns are numbered from 0. |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{({WRefLabel},_) |-> _} |
name: |
getCursorPosition |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
WidgetRef -> GuiPort -> Prelude.IO (Prelude.Int, Prelude.Int) |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |