pub trait NotebookExt:
IsA<Notebook>
+ Sealed
+ '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 { ... }
}Provided Methods§
Sourcefn detach_tab(&self, child: &impl IsA<Widget>)
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
Sourcefn action_widget(&self, pack_type: PackType) -> Option<Widget>
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
Sourcefn group_name(&self) -> Option<GString>
fn group_name(&self) -> 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.
Sourcefn is_scrollable(&self) -> bool
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
Sourcefn shows_border(&self) -> bool
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
Sourcefn shows_tabs(&self) -> bool
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
Sourcefn tab_is_detachable(&self, child: &impl IsA<Widget>) -> bool
fn tab_is_detachable(&self, child: &impl IsA<Widget>) -> bool
Sourcefn tab_pos(&self) -> PositionType
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
Sourcefn tab_is_reorderable(&self, child: &impl IsA<Widget>) -> bool
fn tab_is_reorderable(&self, child: &impl IsA<Widget>) -> bool
Sourcefn next_page(&self)
fn next_page(&self)
Switches to the next page. Nothing happens if the current page is the last page.
Sourcefn popup_disable(&self)
fn popup_disable(&self)
Disables the popup menu.
Sourcefn popup_enable(&self)
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.
Sourcefn prev_page(&self)
fn prev_page(&self)
Switches to the previous page. Nothing happens if the current page is the first page.
Sourcefn set_action_widget(&self, widget: &impl IsA<Widget>, pack_type: PackType)
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
Sourcefn set_group_name(&self, group_name: Option<&str>)
fn set_group_name(&self, group_name: Option<&str>)
Sourcefn set_scrollable(&self, scrollable: bool)
fn set_scrollable(&self, scrollable: bool)
Sourcefn set_show_border(&self, show_border: bool)
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
Sourcefn set_show_tabs(&self, show_tabs: bool)
fn set_show_tabs(&self, show_tabs: bool)
Sourcefn set_tab_detachable(&self, child: &impl IsA<Widget>, detachable: bool)
fn set_tab_detachable(&self, child: &impl IsA<Widget>, detachable: bool)
Sets whether the tab can be detached from self to another
notebook or widget.
Note that 2 notebooks must share a common group identificator
(see set_group_name()) to allow automatic tabs
interchange between them.
If you want a widget to interact with a notebook through DnD (i.e.: accept dragged tabs from it) it must be set as a drop destination and accept the target “GTK_NOTEBOOK_TAB”. The notebook will fill the selection with a GtkWidget** pointing to the child widget that corresponds to the dropped tab.
Note that you should use detach_tab() instead
of ContainerExt::remove() if you want to remove the tab from
the source notebook as part of accepting a drop. Otherwise,
the source notebook will think that the dragged tab was
removed from underneath the ongoing drag operation, and
will initiate a drag cancel animation.
⚠️ The following code is in C ⚠️
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
Sourcefn set_tab_label_text(&self, child: &impl IsA<Widget>, tab_text: &str)
fn set_tab_label_text(&self, child: &impl IsA<Widget>, tab_text: &str)
Sourcefn set_tab_pos(&self, pos: PositionType)
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
Sourcefn set_tab_reorderable(&self, child: &impl IsA<Widget>, reorderable: bool)
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_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
Sourcefn connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>(
&self,
f: F,
) -> SignalHandlerId
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
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)
Sourcefn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_page_reordered<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
Sourcefn connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>(
&self,
f: F,
) -> SignalHandlerId
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".