startEditing :: IORef SpreadsheetProperties -> Ref Input -> Ref Table -> TableCoordinate -> IO ()
startEditing props' intInput' table' (TableCoordinate (Row row') (Column col')) = do
  modifyIORef props' (\p' -> p' {rowEdit = row', colEdit = col'})
  _p <- readIORef props'
  setSelection table'
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
  rectangle' <- findCell table' ContextCell (TableCoordinate (Row (rowEdit _p)) (Column  (colEdit _p)))
  case rectangle' of
    Just rect' -> do
      resize intInput' rect'
      let cellContents = (values _p) !! (rowEdit _p) !! (colEdit _p)
      _ <- setValue intInput' (T.pack (show cellContents))
      _ <- setPosition intInput' 0 (Just (length $ show cellContents))
      showWidget intInput'
      _ <- takeFocus intInput'
      return ()
    _ -> return ()
startEditing :: IORef SpreadsheetProperties -> Ref Input -> Ref Table -> TableCoordinate -> IO ()
startEditing props' intInput' table' (TableCoordinate (Row row') (Column col')) = do
  modifyIORef props' (\p' -> p' {rowEdit = row', colEdit = col'})
  _p <- readIORef props'
  setSelection table'
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
  rectangle' <- findCell table' ContextCell (TableCoordinate (Row (rowEdit _p)) (Column  (colEdit _p)))
  case rectangle' of
    Just rect' -> do
      resize intInput' rect'
      let cellContents = (values _p) !! (rowEdit _p) !! (colEdit _p)
      _ <- setValue intInput' (T.pack (show cellContents))
      _ <- setPosition intInput' 0 (Just (length $ show cellContents))
      showWidget intInput'
      _ <- takeFocus intInput'
      return ()
    _ -> return ()
startEditing props' intInput' table' (TableCoordinate (Row row') (Column col')) = do
  modifyIORef props' (\p' -> p' {rowEdit = row', colEdit = col'})
  _p <- readIORef props'
  setSelection table'
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
    (TableCoordinate (Row (rowEdit _p)) (Column (colEdit _p)))
  rectangle' <- findCell table' ContextCell (TableCoordinate (Row (rowEdit _p)) (Column  (colEdit _p)))
  case rectangle' of
    Just rect' -> do
      resize intInput' rect'
      let cellContents = (values _p) !! (rowEdit _p) !! (colEdit _p)
      _ <- setValue intInput' (T.pack (show cellContents))
      _ <- setPosition intInput' 0 (Just (length $ show cellContents))
      showWidget intInput'
      _ <- takeFocus intInput'
      return ()
    _ -> return ()