Skip to main content

NotebookExt

Trait NotebookExt 

Source
pub trait NotebookExt: IsA<Notebook> + 'static {
Show 69 methods // Provided methods fn detach_tab(&self, child: &impl IsA<Widget>) { ... } fn action_widget(&self, pack_type: PackType) -> Option<Widget> { ... } fn group_name(&self) -> Option<GString> { ... } fn menu_label(&self, child: &impl IsA<Widget>) -> Option<Widget> { ... } fn menu_label_text(&self, child: &impl IsA<Widget>) -> Option<GString> { ... } fn is_scrollable(&self) -> bool { ... } fn shows_border(&self) -> bool { ... } fn shows_tabs(&self) -> bool { ... } fn tab_is_detachable(&self, child: &impl IsA<Widget>) -> bool { ... } fn tab_label(&self, child: &impl IsA<Widget>) -> Option<Widget> { ... } fn tab_label_text(&self, child: &impl IsA<Widget>) -> Option<GString> { ... } fn tab_pos(&self) -> PositionType { ... } fn tab_is_reorderable(&self, child: &impl IsA<Widget>) -> bool { ... } fn next_page(&self) { ... } fn popup_disable(&self) { ... } fn popup_enable(&self) { ... } fn prev_page(&self) { ... } fn set_action_widget(&self, widget: &impl IsA<Widget>, pack_type: PackType) { ... } fn set_group_name(&self, group_name: Option<&str>) { ... } fn set_menu_label( &self, child: &impl IsA<Widget>, menu_label: Option<&impl IsA<Widget>>, ) { ... } fn set_menu_label_text(&self, child: &impl IsA<Widget>, menu_text: &str) { ... } fn set_scrollable(&self, scrollable: bool) { ... } fn set_show_border(&self, show_border: bool) { ... } fn set_show_tabs(&self, show_tabs: bool) { ... } fn set_tab_detachable(&self, child: &impl IsA<Widget>, detachable: bool) { ... } fn set_tab_label( &self, child: &impl IsA<Widget>, tab_label: Option<&impl IsA<Widget>>, ) { ... } fn set_tab_label_text(&self, child: &impl IsA<Widget>, tab_text: &str) { ... } fn set_tab_pos(&self, pos: PositionType) { ... } fn set_tab_reorderable(&self, child: &impl IsA<Widget>, reorderable: bool) { ... } fn enables_popup(&self) -> bool { ... } fn set_enable_popup(&self, enable_popup: bool) { ... } fn page(&self) -> i32 { ... } fn set_page(&self, page: i32) { ... } fn child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool) { ... } fn child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<GString> { ... } fn set_child_menu_label<T: IsA<Widget>>( &self, item: &T, menu_label: Option<&str>, ) { ... } fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32 { ... } fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32) { ... } fn child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool) { ... } fn child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool) { ... } fn child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool { ... } fn set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool) { ... } fn child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<GString> { ... } fn set_child_tab_label<T: IsA<Widget>>( &self, item: &T, tab_label: Option<&str>, ) { ... } fn connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_change_current_page(&self, object: i32) -> bool { ... } fn connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_focus_tab(&self, object: NotebookTab) -> bool { ... } fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_move_focus_out(&self, object: DirectionType) { ... } fn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool { ... } fn connect_select_page<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_select_page(&self, object: bool) -> bool { ... } fn connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_enable_popup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_group_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_page_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_scrollable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_border_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_tabs_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_tab_pos_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Notebook methods.

§Implementors

Notebook

Provided Methods§

Source

fn detach_tab(&self, child: &impl IsA<Widget>)

Removes the child from the notebook.

This function is very similar to ContainerExt::remove(), but additionally informs the notebook that the removal is happening as part of a tab DND operation, which should not be cancelled.

§child

a child

Source

fn action_widget(&self, pack_type: PackType) -> Option<Widget>

Gets one of the action widgets. See set_action_widget().

§pack_type

pack type of the action widget to receive

§Returns

The action widget with the given pack_type or None when this action widget has not been set

Source

fn group_name(&self) -> Option<GString>

Gets the current group name for self.

§Returns

the group name, or None if none is set

Source

fn menu_label(&self, child: &impl IsA<Widget>) -> Option<Widget>

Retrieves the menu label widget of the page containing child.

§child

a widget contained in a page of self

§Returns

the menu label, or None if the notebook page does not have a menu label other than the default (the tab label).

Source

fn menu_label_text(&self, child: &impl IsA<Widget>) -> Option<GString>

Retrieves the text of the menu label for the page containing child.

§child

the child widget of a page of the notebook.

§Returns

the text of the tab label, or None if the widget does not have a menu label other than the default menu label, or the menu label widget is not a Label. The string is owned by the widget and must not be freed.

Source

fn is_scrollable(&self) -> bool

Returns whether the tab label area has arrows for scrolling. See set_scrollable().

§Returns

true if arrows for scrolling are present

Source

fn shows_border(&self) -> bool

Returns whether a bevel will be drawn around the notebook pages. See set_show_border().

§Returns

true if the bevel is drawn

Source

fn shows_tabs(&self) -> bool

Returns whether the tabs of the notebook are shown. See set_show_tabs().

§Returns

true if the tabs are shown

Source

fn tab_is_detachable(&self, child: &impl IsA<Widget>) -> bool

Returns whether the tab contents can be detached from self.

§child

a child Widget

§Returns

true if the tab is detachable.

Source

fn tab_label(&self, child: &impl IsA<Widget>) -> Option<Widget>

Returns the tab label widget for the page child. None is returned if child is not in self or if no tab label has specifically been set for child.

§child

the page

§Returns

the tab label

Source

fn tab_label_text(&self, child: &impl IsA<Widget>) -> Option<GString>

Retrieves the text of the tab label for the page containing child.

§child

a widget contained in a page of self

§Returns

the text of the tab label, or None if the tab label widget is not a Label. The string is owned by the widget and must not be freed.

Source

fn tab_pos(&self) -> PositionType

Gets the edge at which the tabs for switching pages in the notebook are drawn.

§Returns

the edge at which the tabs are drawn

Source

fn tab_is_reorderable(&self, child: &impl IsA<Widget>) -> bool

Gets whether the tab can be reordered via drag and drop or not.

§child

a child Widget

§Returns

true if the tab is reorderable.

Source

fn next_page(&self)

Switches to the next page. Nothing happens if the current page is the last page.

Source

fn popup_disable(&self)

Disables the popup menu.

Source

fn popup_enable(&self)

Enables the popup menu: if the user clicks with the right mouse button on the tab labels, a menu with all the pages will be popped up.

Source

fn prev_page(&self)

Switches to the previous page. Nothing happens if the current page is the first page.

Source

fn set_action_widget(&self, widget: &impl IsA<Widget>, pack_type: PackType)

Sets widget as one of the action widgets. Depending on the pack type the widget will be placed before or after the tabs. You can use a Box if you need to pack more than one widget on the same side.

Note that action widgets are “internal” children of the notebook and thus not included in the list returned from ContainerExt::foreach().

§widget

a Widget

§pack_type

pack type of the action widget

Source

fn set_group_name(&self, group_name: Option<&str>)

Sets a group name for self.

Notebooks with the same name will be able to exchange tabs via drag and drop. A notebook with a None group name will not be able to exchange tabs with any other notebook.

§group_name

the name of the notebook group, or None to unset it

Source

fn set_menu_label( &self, child: &impl IsA<Widget>, menu_label: Option<&impl IsA<Widget>>, )

Changes the menu label for the page containing child.

§child

the child widget

the menu label, or None for default

Source

fn set_menu_label_text(&self, child: &impl IsA<Widget>, menu_text: &str)

Creates a new label and sets it as the menu label of child.

§child

the child widget

the label text

Source

fn set_scrollable(&self, scrollable: bool)

Sets whether the tab label area will have arrows for scrolling if there are too many tabs to fit in the area.

§scrollable

true if scroll arrows should be added

Source

fn set_show_border(&self, show_border: bool)

Sets whether a bevel will be drawn around the notebook pages. This only has a visual effect when the tabs are not shown. See set_show_tabs().

§show_border

true if a bevel should be drawn around the notebook

Source

fn set_show_tabs(&self, show_tabs: bool)

Sets whether to show the tabs for the notebook or not.

§show_tabs

true if the tabs should be shown

Source

fn set_tab_detachable(&self, child: &impl IsA<Widget>, detachable: bool)

static void on_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data) { GtkWidget *notebook; GtkWidget **child;

notebook = gtk_drag_get_source_widget (context); child = (void*) gtk_selection_data_get_data (data);

// process_widget (*child);

gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child); } ]|

If you want a notebook to accept drags from other widgets, you will have to set your own DnD code to do it.

§child

a child Widget

§detachable

whether the tab is detachable or not

Source

fn set_tab_label( &self, child: &impl IsA<Widget>, tab_label: Option<&impl IsA<Widget>>, )

Changes the tab label for child. If None is specified for tab_label, then the page will have the label “page N”.

§child

the page

§tab_label

the tab label widget to use, or None for default tab label

Source

fn set_tab_label_text(&self, child: &impl IsA<Widget>, tab_text: &str)

Creates a new label and sets it as the tab label for the page containing child.

§child

the page

§tab_text

the label text

Source

fn set_tab_pos(&self, pos: PositionType)

Sets the edge at which the tabs for switching pages in the notebook are drawn.

§pos

the edge to draw the tabs at

Source

fn set_tab_reorderable(&self, child: &impl IsA<Widget>, reorderable: bool)

Sets whether the notebook tab can be reordered via drag and drop or not.

§child

a child Widget

§reorderable

whether the tab is reorderable or not

Source

fn enables_popup(&self) -> bool

Source

fn set_enable_popup(&self, enable_popup: bool)

Source

fn page(&self) -> i32

Source

fn set_page(&self, page: i32)

Source

fn child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool)

Source

fn child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<GString>

Source

fn set_child_menu_label<T: IsA<Widget>>( &self, item: &T, menu_label: Option<&str>, )

Source

fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32

Source

fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32)

Source

fn child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool)

Source

fn child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool)

Source

fn child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool)

Source

fn child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<GString>

Source

fn set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>)

Source

fn connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn emit_change_current_page(&self, object: i32) -> bool

Source

fn connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>( &self, f: F, ) -> SignalHandlerId

The ::create-window signal is emitted when a detachable tab is dropped on the root window.

A handler for this signal can create a window containing a notebook where the tab will be attached. It is also responsible for moving/resizing the window and adding the necessary properties to the notebook (e.g. the group-name ).

§page

the tab of notebook that is being detached

§x

the X coordinate where the drop happens

§y

the Y coordinate where the drop happens

§Returns

a Notebook that page should be added to, or None.

Source

fn connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn emit_focus_tab(&self, object: NotebookTab) -> bool

Source

fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn emit_move_focus_out(&self, object: DirectionType)

Source

fn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

the ::page-added signal is emitted in the notebook right after a page is added to the notebook.

§child

the child Widget affected

§page_num

the new page number for child

Source

fn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

the ::page-removed signal is emitted in the notebook right after a page is removed from the notebook.

§child

the child Widget affected

§page_num

the child page number

Source

fn connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

the ::page-reordered signal is emitted in the notebook right after a page has been reordered.

§child

the child Widget affected

§page_num

the new page number for child

Source

fn connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool

Source

fn connect_select_page<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn emit_select_page(&self, object: bool) -> bool

Source

fn connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the user or a function changes the current page.

§page

the new current page

§page_num

the index of the page

Source

fn connect_enable_popup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_group_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_scrollable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_show_border_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_show_tabs_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_tab_pos_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§