TfeTextView is a child object of GtkTextView. If its contents comes from a file, it holds the pointer to the GFile. Otherwise, the pointer is NULL.
GObject -- GInitiallyUnowned -- GtkWidget -- GtkTextView -- TfeTextView
constructors
GtkWidget *
tfe_text_view_new (void);
Creates a new TfeTextView instance and returns the pointer to it as
GtkWidget. If an error happens, it returns NULL
.
Return value
GtkWidget *
tfe_text_view_new_with_file (GFile *file);
Creates a new TfeTextView, reads the contents of the
file
and set it to the GtkTextBuffer corresponds to the
newly created TfeTextView. Then returns the pointer to the TfeTextView
as GtkWidget. If an error happens, it returns NULL
.
Parameters
Return value
Instance methods
GFile *
tfe_text_view_get_file (TfeTextView *tv);
Returns the copy of the GFile in the TfeTextView.
Parameters
Return value
void
tfe_text_view_open (TfeTextView *tv, GtkWidget *win);
Shows a file chooser dialog so that a user can choose a file to read.
Then, read the file and set the buffer with the contents. This function
doesn’t return the I/O status. Instead, the status is informed by
open-response
signal. The caller needs to set a handler to
this signal in advance.
parameters
void
tfe_text_view_save (TfeTextView *tv);
Saves the contents of the buffer to the file. If tv
holds a GFile, it is used. Otherwise, this function shows a file chooser
dialog so that the user can choose a file to save.
Parameters
void
tfe_text_view_saveas (TfeTextView *tv);
Saves the contents of the buffer to a file. This function shows file chooser dialog so that a user can choose a file to save.
Parameters
Signals
void
user_function (TfeTextView *tv,
gpointer user_data)
Emitted when the GFile in the TfeTextView object is changed. The signal is emitted when:
void
user_function (TfeTextView *tv,
TfeTextViewOpenResponseType response-id,
gpointer user_data)
Emitted after the user calls tfe_text_view_open
. This
signal informs the status of file I/O operation.
Enumerations
Predefined values for the response id given by
open-response
signal.
Members: