Tepl.Tab¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Grid (21), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2), Tepl.TabGroup (8)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Tepl.TabGroup (4)
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Child Properties¶
- Inherited:
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Tepl.Tab(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
-
Creates a new
Tepl.Tab
with a newTepl.View
. The newTepl.View
can be retrieved afterwards withTepl.Tab.get_view
().New in version 3.0.
- classmethod new_with_view(view)¶
- Parameters:
view (
Tepl.View
) – theTepl.View
that will be contained in the tab.- Returns:
a new
Tepl.Tab
.- Return type:
New in version 3.0.
- add_info_bar(info_bar)¶
- Parameters:
info_bar (
Gtk.InfoBar
) – aGtk.InfoBar
.
Attaches info_bar to self.
This function calls the ::pack_info_bar virtual function.
New in version 1.0.
- get_buffer()¶
- Returns:
the
Tepl.Buffer
of theTepl.Tab
:view
.- Return type:
A convenience function that calls
Gtk.TextView.get_buffer
() on theTepl.Tab
:view
associated with the self.New in version 3.0.
- get_goto_line_bar()¶
- Returns:
the
Tepl.GotoLineBar
widget belonging to self.- Return type:
Gets the
Tepl.GotoLineBar
widget belonging to self. TheTepl.GotoLineBar
must not be destroyed by the application, the purpose of this function is to show/hide the widget.New in version 5.0.
- load_file(location)¶
-
Unconditionally loads a file in self, regardless if there are unsaved changes in the
Gtk.TextBuffer
. The previous buffer content is lost.This function is asynchronous, there is no way to know when the file loading is finished.
New in version 4.0.
- save_as_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied.
Shows a
Gtk.FileChooser
to save the self to a different location, creates an appropriateTepl.FileSaver
and asynchronously runs it.See the
Gio.AsyncResult
documentation to know how to use this function.New in version 4.0.
- save_as_async_simple()¶
The same as
Tepl.Tab.save_as_async
(), but without callback.This function is useful when you don’t need to know:
when the operation is finished;
and whether the operation ran successfully.
New in version 4.0.
- save_as_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
.- Returns:
whether the tab was saved successfully.
- Return type:
Finishes a tab saving started with
Tepl.Tab.save_as_async
().New in version 4.0.
- save_async(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfied.
Saves asynchronously the content of the self. The
Tepl.File
:location
must not beNone
.See the
Gio.AsyncResult
documentation to know how to use this function.New in version 4.0.
- save_async_simple()¶
The same as
Tepl.Tab.save_async
(), but without callback.This function is useful when you don’t need to know:
when the operation is finished;
and whether the operation ran successfully.
New in version 4.0.
- save_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
.- Returns:
whether the tab was saved successfully.
- Return type:
Finishes a tab saving started with
Tepl.Tab.save_async
().New in version 4.0.
- do_close_request() virtual¶
- do_pack_goto_line_bar(goto_line_bar) virtual¶
- Parameters:
goto_line_bar (
Tepl.GotoLineBar
) –
- do_pack_info_bar(info_bar) virtual¶
- Parameters:
info_bar (
Gtk.InfoBar
) –
Signal Details¶
- Tepl.Tab.signals.close_request(tab)¶
- Signal Name:
close-request
- Flags:
- Parameters:
tab (
Tepl.Tab
) – The object which received the signal
The
::close-request
signal is emitted when there is a request to close theTepl.Tab
, for example if the user clicks on a close button.The default object method handler does the following:
If the buffer is not modified (according to
Gtk.TextBuffer.get_modified
()), close the tab.Else, show a message dialog to propose to save the file before closing.
To override the default object method handler, either override the virtual function in a
Tepl.Tab
subclass or connect to the signal and callGObject.signal_stop_emission_by_name
().New in version 3.0.