-bool wxTextCtrl::LoadFile(const wxString& file)
-{
-    if (!wxFileExists(file))
-        return FALSE;
-
-    m_fileName = file;
-
-    Clear();
-
-    Widget textWidget = (Widget) m_mainWidget;
-    FILE *fp;
-
-    struct stat statb;
-    if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
-        !(fp = fopen ((char*) (const char*) file, "r")))
-    {
-        return FALSE;
-    }
-    else
-    {
-        long len = statb.st_size;
-        char *text;
-        if (!(text = XtMalloc ((unsigned) (len + 1))))
-        {
-            fclose (fp);
-            return FALSE;
-        }
-        if (fread (text, sizeof (char), len, fp) != (size_t) len)
-        {
-        }
-        fclose (fp);
-
-        text[len] = 0;
-        XmTextSetString (textWidget, text);
-        //      m_textPosition = len;
-        XtFree (text);
-        m_modified = FALSE;
-        return TRUE;
-    }
-}
-
-// If file is null, try saved file name first
-// Returns TRUE if succeeds.
-bool wxTextCtrl::SaveFile(const wxString& file)
-{
-    wxString theFile(file);
-    if (theFile == "")
-        theFile = m_fileName;
-    if (theFile == "")
-        return FALSE;
-    m_fileName = theFile;
-
-    Widget textWidget = (Widget) m_mainWidget;
-    FILE *fp;
-
-    if (!(fp = fopen ((char*) (const char*) theFile, "w")))
-    {
-        return FALSE;
-    }
-    else
-    {
-        char *text = XmTextGetString (textWidget);
-        long len = XmTextGetLastPosition (textWidget);
-
-        if (fwrite (text, sizeof (char), len, fp) != (size_t) len)
-        {
-            // Did not write whole file
-        }
-        // Make sure newline terminates the file
-        if (text[len - 1] != '\n')
-            fputc ('\n', fp);
-
-        fclose (fp);
-        XtFree (text);
-        m_modified = FALSE;
-        return TRUE;
-    }
-}
-
-void wxTextCtrl::WriteText(const wxString& text)
-{
-    long textPosition = GetInsertionPoint() + strlen (text);
-    XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(), (char*) (const char*) text);
-    XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
-    SetInsertionPoint(textPosition);
-    XmTextShowPosition ((Widget) m_mainWidget, textPosition);
-    m_modified = TRUE;
-}
-
-void wxTextCtrl::AppendText(const wxString& text)
-{
-    long textPosition = GetLastPosition() + strlen(text);
-    XmTextInsert ((Widget) m_mainWidget, GetLastPosition(), (char*) (const char*) text);
-    XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
-    SetInsertionPoint(textPosition);
-    XmTextShowPosition ((Widget) m_mainWidget, textPosition);
-    m_modified = TRUE;
-}
-
-void wxTextCtrl::Clear()