Description
This widget implements a graphical "more" command. It allows the
user to view a text file. There are various possible ways to
specify the contents to display: loading the data from a file (by
providing a filename) or by loading it from an open C FILE data
stream or from the output of a Unix command or from a Unix file
descriptor.
The following is a simple example of its use. The code creates a
GnomeLess widget, sets a custom font, and fills the widget with
the contents of a file.
Details
gnome_less_new ()
GtkWidget* gnome_less_new (void); |
Creates a new GnomeLess widget.
gnome_less_clear ()
Clears all text from GnomeLess widget gl.
gnome_less_show_file ()
gboolean gnome_less_show_file (GnomeLess *gl,
const gchar *path); |
Displays a file in a GnomeLess widget. Replaces any text already being displayed
in the widget.
gnome_less_show_command ()
gboolean gnome_less_show_command (GnomeLess *gl,
const gchar *command_line); |
Runs the shell command specified in command_line, and places the output of that command
in the GnomeLess widget specified by gl. Replaces any text already being displayed in the
widget.
gnome_less_show_string ()
void gnome_less_show_string (GnomeLess *gl,
const gchar *s); |
Displays a string in the GnomeLess widget gl. Replaces any text
already being displayed.
gnome_less_show_filestream ()
gboolean gnome_less_show_filestream (GnomeLess *gl,
FILE *f); |
Reads all of the text from filestream f, and places it in the GnomeLess widget gl. Replaces any text
already being displayed.
gnome_less_show_fd ()
gboolean gnome_less_show_fd (GnomeLess *gl,
int file_descriptor); |
Reads all of the text from file descriptor file_descriptor, and places it in the GnomeLess widget gl.
Replaces any text already being displayed.
gnome_less_write_file ()
gboolean gnome_less_write_file (GnomeLess *gl,
const gchar *path); |
Writes the text displayed in the GnomeLess widget gl to the file specified by path.
gnome_less_write_fd ()
gboolean gnome_less_write_fd (GnomeLess *gl,
int fd); |
Writes the text displayed in the GnomeLess widget gl to file descriptor fd.
gnome_less_set_font ()
void gnome_less_set_font (GnomeLess *gl,
GdkFont *font); |
Sets the font of the text to be displayed in the GnomeLess widget gl to font.
Note: This will not affect text already being displayed.
If you use this function after adding text to the widget, you must show it again
by using gnome_less_reshow or one of the gnome_less_show commands.
gnome_less_set_fixed_font ()
void gnome_less_set_fixed_font (GnomeLess *gl,
gboolean fixed); |
Specifies whether or not new text should be displayed using a fixed font. Pass TRUE
in fixed to use a fixed font, or FALSE to revert to the default GtkText font.
Note: This will not affect text already being displayed.
If you use this function after adding text to the widget, you must show it again
by using gnome_less_reshow or one of the gnome_less_show commands.
gnome_less_reshow ()
Re-displays all of the text in the GnomeLess widget gl. If the font has changed since
the last show/reshow of text, it will update the current text to the new font.