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.Tabwith a newTepl.View. The newTepl.Viewcan be retrieved afterwards withTepl.Tab.get_view().New in version 3.0.
- classmethod new_with_view(view)¶
- Parameters:
view (
Tepl.View) – theTepl.Viewthat 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.Bufferof theTepl.Tab:view.- Return type:
A convenience function that calls
Gtk.TextView.get_buffer() on theTepl.Tab:viewassociated with the self.New in version 3.0.
- get_goto_line_bar()¶
- Returns:
the
Tepl.GotoLineBarwidget belonging to self.- Return type:
Gets the
Tepl.GotoLineBarwidget belonging to self. TheTepl.GotoLineBarmust 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.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied.
Shows a
Gtk.FileChooserto save the self to a different location, creates an appropriateTepl.FileSaverand asynchronously runs it.See the
Gio.AsyncResultdocumentation 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.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied.
Saves asynchronously the content of the self. The
Tepl.File:locationmust not beNone.See the
Gio.AsyncResultdocumentation 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¶
For the
Tepl.Tab::close-requestsignal.
- do_pack_goto_line_bar(goto_line_bar) virtual¶
- Parameters:
goto_line_bar (
Tepl.GotoLineBar) –
Virtual function pointer to add a
Tepl.GotoLineBarin theTepl.Tabcontainer. By default theTepl.GotoLineBaris added at the bottom.
- do_pack_info_bar(info_bar) virtual¶
- Parameters:
info_bar (
Gtk.InfoBar) –
Virtual function pointer to add a
Gtk.InfoBarin theTepl.Tabcontainer. By default theGtk.InfoBaris inserted just above theGtk.ScrolledWindowcontaining theTepl.View.
- do_pack_view(view) virtual¶
- Parameters:
view (
Tepl.View) –
Virtual function pointer to add the
Tepl.Viewin theTepl.Tabcontainer. Called only once at object construction time, when theTepl.Tab:viewproperty is set. By default theTepl.Viewis added to aGtk.ScrolledWindowand theGtk.ScrolledWindowis added to theTepl.TabwithGtk.Container.add().
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-requestsignal 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.Tabsubclass or connect to the signal and callGObject.signal_stop_emission_by_name().New in version 3.0.