Top |
gboolean | autosave | Read / Write |
int | autosave-interval | Read / Write |
gboolean | can-close | Read |
char * | name | Read |
GeditTabState | state | Read |
GEnum ╰── GeditTabState GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GeditTab
GeditTab is a GtkContainer that contains a GeditView and can show other widgets such as a TeplInfoBar.
void gedit_tab_load_file (GeditTab *tab
,GFile *location
,const GtkSourceEncoding *encoding
,gint line_pos
,gint column_pos
,gboolean create
);
This function tries to load location
into tab
. It is usually called only on
a newly-created tab.
If location
doesn't exist, the behavior depends on create
:
If create
is FALSE
, an error is shown.
If create
is TRUE
, an empty GeditDocument is created without error (but
the file is not yet created on disk).
The tab
needs to be in GEDIT_TAB_STATE_NORMAL
. The previous
GtkTextBuffer's content is lost.
tab |
a GeditTab. |
|
location |
the GFile to load. |
|
encoding |
a GtkSourceEncoding, or |
[nullable] |
line_pos |
the line position to visualize. |
|
column_pos |
the column position to visualize. |
|
create |
|
Since: 45
void gedit_tab_load_stream (GeditTab *tab
,GInputStream *stream
,const GtkSourceEncoding *encoding
,gint line_pos
,gint column_pos
);
Loads stream
into tab
. This function is usually called only on a
newly-created tab.
The tab
needs to be in GEDIT_TAB_STATE_NORMAL
. The previous
GtkTextBuffer's content is lost.
tab |
a GeditTab. |
|
stream |
the GInputStream to load, e.g. stdin. |
|
encoding |
a GtkSourceEncoding, or |
[nullable] |
line_pos |
the line position to visualize. |
|
column_pos |
the column position to visualize. |
Since: 45
GeditDocument *
gedit_tab_get_document (GeditTab *tab
);
Convenience function. It is equivalent to call gedit_tab_get_view()
followed
by gtk_text_view_get_buffer()
.
void gedit_tab_set_auto_save_enabled (GeditTab *tab
,gboolean enable
);
Sets the “autosave” property.
It does not install an autosave timeout if the document is new or is read-only.
void gedit_tab_set_auto_save_interval (GeditTab *tab
,gint interval
);
Sets the “autosave-interval” property.
void gedit_tab_set_info_bar (GeditTab *tab
,GtkWidget *info_bar
);
Sets the GtkInfoBar of tab
. Note that there can be only one GtkInfoBar per
GeditTab. If there was already an infobar set, it is destroyed and replaced
by the new one.
See also TeplInfoBar, it permits to create a GtkInfoBar more easily.
The state of a GeditTab. Note that the enumerators are not flags, so they cannot be combined. A GeditTab is in only one state at a time.
“autosave”
property“autosave” gboolean
Whether the autosave feature is enabled.
Owner: GeditTab
Flags: Read / Write
Default value: TRUE
“autosave-interval”
property “autosave-interval” int
Time in minutes between two autosaves.
Owner: GeditTab
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“can-close”
property“can-close” gboolean
Whether the tab can be closed.
Owner: GeditTab
Flags: Read
Default value: TRUE
“name”
property “name” char *
The tab's name.
GeditTab:name
has been deprecated since version 47 and should not be used in newly-written code.
Use the “tepl-short-title” property instead.
Owner: GeditTab
Flags: Read
Default value: NULL
“state”
property“state” GeditTabState
The state of the GeditTab.
Owner: GeditTab
Flags: Read
Default value: GEDIT_TAB_STATE_NORMAL