+ wxCHECK_MSG( m_text != NULL, FALSE, "invalid text ctrl" );
+
+ if (!wxFileExists(file)) return FALSE;
+
+ Clear();
+
+ FILE *fp = NULL;
+ 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
+ {
+ gint len = statb.st_size;
+ char *text;
+ if (!(text = (char*)malloc ((unsigned) (len + 1))))
+ {
+ fclose (fp);
+ return FALSE;
+ }
+ if (fread (text, sizeof (char), len, fp) != (size_t) len)
+ {
+ }
+ fclose (fp);
+
+ text[len] = 0;
+
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ gtk_editable_insert_text( GTK_EDITABLE(m_text), text, 0, &len );
+ }
+ else
+ {
+ gtk_entry_set_text( GTK_ENTRY(m_text), text );
+ }