TeplTab

TeplTab — Contains a TeplView and GtkInfoBars

Functions

Properties

TeplView * view Read / Write / Construct Only

Signals

Types and Values

  TeplTab
struct TeplTabClass

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkGrid
                    ╰── TeplTab

Implemented Interfaces

TeplTab implements AtkImplementorIface, GtkBuildable, GtkOrientable and TeplTabGroup.

Includes

#include <tepl/tepl.h>

Description

TeplTab is meant to be the content of one tab in the text editor (if the text editor has a Tabbed Document Interface). It is a GtkGrid container that contains the TeplView and can contain one or several GtkInfoBar's. Since it is a GtkGrid, an application can of course add any other widget to it.

To create a new GtkInfoBar, it is recommended to use TeplInfoBar (but TeplTab doesn't enforce it).

By default:

The way that the TeplView is packed into the TeplTab is customizable with the ::pack_view virtual function. Similarly, the way that GtkInfoBar's are added can be customized with ::pack_info_bar.

TeplTabGroup implementation

TeplTab implements the TeplTabGroup interface, for a group of only one tab. It is useful for text editors that open each file in a separate window, or for applications that don't require to open more than one file. But the tepl_tab_group_append_tab() operation is not supported, so some higher-level features of Tepl don't work with TeplTab as the TeplTabGroup of the window. This will maybe be improved in the future by creating automatically a new window.

Functions

tepl_tab_new ()

TeplTab *
tepl_tab_new (void);

Creates a new TeplTab with a new TeplView. The new TeplView can be retrieved afterwards with tepl_tab_get_view().

Returns

a new TeplTab.

Since: 3.0


tepl_tab_new_with_view ()

TeplTab *
tepl_tab_new_with_view (TeplView *view);

Parameters

view

the TeplView that will be contained in the tab.

 

Returns

a new TeplTab.

Since: 3.0


tepl_tab_get_view ()

TeplView *
tepl_tab_get_view (TeplTab *tab);

Parameters

tab

a TeplTab.

 

Returns

the TeplView contained in tab .

[transfer none]

Since: 3.0


tepl_tab_get_buffer ()

TeplBuffer *
tepl_tab_get_buffer (TeplTab *tab);

A convenience function that calls gtk_text_view_get_buffer() on the “view” associated with the tab .

Parameters

tab

a TeplTab.

 

Returns

the TeplBuffer of the “view”.

[transfer none]

Since: 3.0


tepl_tab_add_info_bar ()

void
tepl_tab_add_info_bar (TeplTab *tab,
                       GtkInfoBar *info_bar);

Attaches info_bar to tab .

This function calls the ::pack_info_bar virtual function.

Parameters

tab

a TeplTab.

 

info_bar

a GtkInfoBar.

 

Since: 1.0

Types and Values

TeplTab

typedef struct _TeplTab TeplTab;

struct TeplTabClass

struct TeplTabClass {
	GtkGridClass parent_class;

	/* Vfuncs */

	void (* pack_view)		(TeplTab  *tab,
					 TeplView *view);

	void (* pack_info_bar) (TeplTab    *tab,
					 GtkInfoBar *info_bar);

	/* Signals */

	void (* close_request) (TeplTab *tab);
};

Members

pack_view ()

Virtual function pointer to add the TeplView in the TeplTab container. Called only once at object construction time, when the “view” property is set. By default the TeplView is added to a GtkScrolledWindow and the GtkScrolledWindow is added to the TeplTab with gtk_container_add().

 

pack_info_bar ()

Virtual function pointer to add a GtkInfoBar in the TeplTab container. By default the GtkInfoBar is inserted above the first non-GtkInfoBar child widget of TeplTab (so by default it is inserted below other GtkInfoBar's, but above the GtkScrolledWindow containing the TeplView).

 

close_request ()

For the “close-request” signal.

 

Property Details

The “view” property

  “view”                     TeplView *

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

Flags: Read / Write / Construct Only

Since: 3.0

Signal Details

The “close-request” signal

void
user_function (TeplTab *tab,
               gpointer user_data)

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

Parameters

tab

the TeplTab emitting the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.0

See Also

TeplInfoBar