Tepl.Tab

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable Tepl.TabGroup Tepl.TabGroup GObject.GInterface->Tepl.TabGroup GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Grid Gtk.Grid Gtk.Container->Gtk.Grid Tepl.Tab Tepl.Tab Gtk.Grid->Tepl.Tab Gtk.Orientable->Gtk.Grid Gtk.Widget->Gtk.Container Tepl.TabGroup->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

new ()

class

new_with_view (view)

add_info_bar (info_bar)

get_buffer ()

get_goto_line_bar ()

get_view ()

load_file (location)

save_as_async (callback, *user_data)

save_as_async_simple ()

save_as_finish (result)

save_async (callback, *user_data)

save_async_simple ()

save_finish (result)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Tepl.TabGroup (4)

do_close_request ()

do_pack_goto_line_bar (goto_line_bar)

do_pack_info_bar (info_bar)

do_pack_view (view)

Properties

Inherited:

Gtk.Grid (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1), Tepl.TabGroup (3)

Name

Type

Flags

Short Description

view

Tepl.View

r/w/co

Child Properties

Inherited:

Gtk.Grid (4)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

close-request

The ::close-request signal is emitted when there is a request to close the Tepl.Tab, for example if the user clicks on a close button.

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.Grid

r

Class Details

class Tepl.Tab(**kwargs)
Bases:

Gtk.Grid, Tepl.TabGroup

Abstract:

No

Structure:

Tepl.TabClass

classmethod new()
Returns:

a new Tepl.Tab.

Return type:

Tepl.Tab

Creates a new Tepl.Tab with a new Tepl.View. The new Tepl.View can be retrieved afterwards with Tepl.Tab.get_view().

New in version 3.0.

classmethod new_with_view(view)
Parameters:

view (Tepl.View) – the Tepl.View that will be contained in the tab.

Returns:

a new Tepl.Tab.

Return type:

Tepl.Tab

New in version 3.0.

add_info_bar(info_bar)
Parameters:

info_bar (Gtk.InfoBar) – a Gtk.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 the Tepl.Tab :view.

Return type:

Tepl.Buffer

A convenience function that calls Gtk.TextView.get_buffer() on the Tepl.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:

Tepl.GotoLineBar

Gets the Tepl.GotoLineBar widget belonging to self. The Tepl.GotoLineBar must not be destroyed by the application, the purpose of this function is to show/hide the widget.

New in version 5.0.

get_view()
Returns:

the Tepl.View contained in self.

Return type:

Tepl.View

New in version 3.0.

load_file(location)
Parameters:

location (Gio.File) – a Gio.File.

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:

Shows a Gtk.FileChooser to save the self to a different location, creates an appropriate Tepl.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) – a Gio.AsyncResult.

Returns:

whether the tab was saved successfully.

Return type:

bool

Finishes a tab saving started with Tepl.Tab.save_as_async().

New in version 4.0.

save_async(callback, *user_data)
Parameters:

Saves asynchronously the content of the self. The Tepl.File :location must not be None.

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) – a Gio.AsyncResult.

Returns:

whether the tab was saved successfully.

Return type:

bool

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) –

do_pack_view(view) virtual
Parameters:

view (Tepl.View) –

Signal Details

Tepl.Tab.signals.close_request(tab)
Signal Name:

close-request

Flags:

RUN_LAST

Parameters:

tab (Tepl.Tab) – The object which received the signal

The ::close-request signal is emitted when there is a request to close the Tepl.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 call GObject.signal_stop_emission_by_name().

New in version 3.0.

Property Details

Tepl.Tab.props.view
Name:

view

Type:

Tepl.View

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Tepl.View contained in the tab. When this property is set, the ::pack_view virtual function is called.

New in version 3.0.