Struct gtk4::Notebook

source ·
#[repr(transparent)]
pub struct Notebook { /* private fields */ }
Expand description

Notebook is a container whose children are pages switched between using tabs.

An example GtkNotebook

There are many configuration options for Notebook. Among other things, you can choose on which edge the tabs appear (see set_tab_pos()), whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added (see set_scrollable()), and whether there will be a popup menu allowing the users to switch pages. (see popup_enable()).

GtkNotebook as GtkBuildable

The Notebook implementation of the Buildable interface supports placing children into tabs by specifying “tab” as the “type” attribute of a element. Note that the content of the tab must be created before the tab can be filled. A tab child can be specified without specifying a type attribute.

To add a child widget in the notebooks action area, specify “action-start” or “action-end” as the “type” attribute of the element.

An example of a UI definition fragment with Notebook:

<object class="GtkNotebook">
  <child>
    <object class="GtkLabel" id="notebook-content">
      <property name="label">Content</property>
    </object>
  </child>
  <child type="tab">
    <object class="GtkLabel" id="notebook-tab">
      <property name="label">Tab</property>
    </object>
  </child>
</object>

CSS nodes

notebook
├── header.top
│   ├── [<action widget>]
│   ├── tabs
│   │   ├── [arrow]
│   │   ├── tab
│   │   │   ╰── <tab label>
┊   ┊   ┊
│   │   ├── tab[.reorderable-page]
│   │   │   ╰── <tab label>
│   │   ╰── [arrow]
│   ╰── [<action widget>]
│
╰── stack
    ├── <child>
    ┊
    ╰── <child>

Notebook has a main CSS node with name notebook, a subnode with name header and below that a subnode with name tabs which contains one subnode per tab with name tab.

If action widgets are present, their CSS nodes are placed next to the tabs node. If the notebook is scrollable, CSS nodes with name arrow are placed as first and last child of the tabs node.

The main node gets the .frame style class when the notebook has a border (see set_show_border()).

The header node gets one of the style class .top, .bottom, .left or .right, depending on where the tabs are placed. For reorderable pages, the tab node gets the .reorderable-page class.

A tab node gets the .dnd style class while it is moved with drag-and-drop.

The nodes are always arranged from left-to-right, regardless of text direction.

Accessibility

Notebook uses the following roles:

Implements

WidgetExt, glib::ObjectExt, AccessibleExt, BuildableExt, ConstraintTargetExt, WidgetExtManual, AccessibleExtManual

Implementations§

source§

impl Notebook

source

pub fn new() -> Notebook

Creates a new Notebook widget with no pages.

Returns

the newly created Notebook

source

pub fn builder() -> NotebookBuilder

Creates a new builder-pattern struct instance to construct Notebook objects.

This method returns an instance of NotebookBuilder which can be used to create Notebook objects.

source

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

Removes the child from the notebook.

This function is very similar to remove_page(), 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

pub 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

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

Gets the current group name for @self.

Returns

the group name, or None if none is set

source

pub 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

pub 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

pub fn page(&self, child: &impl IsA<Widget>) -> NotebookPage

Returns the NotebookPage for @child.

child

a child of @self

Returns

the NotebookPage for @child

source

pub fn pages(&self) -> ListModel

Returns a GListModel that contains the pages of the notebook.

This can be used to keep an up-to-date view. The model also implements SelectionModel and can be used to track and modify the visible page.

Returns

a GListModel for the notebook’s children

source

pub fn is_scrollable(&self) -> bool

Returns whether the tab label area has arrows for scrolling.

Returns

true if arrows for scrolling are present

source

pub fn shows_border(&self) -> bool

Returns whether a bevel will be drawn around the notebook pages.

Returns

true if the bevel is drawn

source

pub fn shows_tabs(&self) -> bool

Returns whether the tabs of the notebook are shown.

Returns

true if the tabs are shown

source

pub 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

pub 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

pub 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 idget is not a Label. The string is owned by the widget and must not be freed.

source

pub fn tab_pos(&self) -> PositionType

Gets the edge at which the tabs are drawn.

Returns

the edge at which the tabs are drawn

source

pub 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

pub fn next_page(&self)

Switches to the next page.

Nothing happens if the current page is the last page.

source

pub fn popup_disable(&self)

Disables the popup menu.

source

pub 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

pub fn prev_page(&self)

Switches to the previous page.

Nothing happens if the current page is the first page.

source

pub 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.

widget

a Widget

pack_type

pack type of the action widget

source

pub 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

pub 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

pub 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

pub 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

pub 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.

show_border

true if a bevel should be drawn around the notebook

source

pub 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

pub 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 two 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 remove_page() 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,
                       GdkDrop          *drop,
                       GtkSelectionData *data,
                       guint             time,
                       gpointer          user_data)
{
  GtkDrag *drag;
  GtkWidget *notebook;
  GtkWidget **child;

  drag = gtk_drop_get_drag (drop);
  notebook = g_object_get_data (drag, "gtk-notebook-drag-origin");
  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

pub 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

pub 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

pub fn set_tab_pos(&self, pos: PositionType)

Sets the edge at which the tabs are drawn.

pos

the edge to draw the tabs at

source

pub 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

pub fn enables_popup(&self) -> bool

If true, pressing the right mouse button on the notebook shows a page switching menu.

source

pub fn set_enable_popup(&self, enable_popup: bool)

If true, pressing the right mouse button on the notebook shows a page switching menu.

source

pub fn set_page(&self, page: i32)

The index of the current page.

source

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

source

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

source

pub fn connect_create_window<F: Fn(&Self, &Widget) -> Option<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 Notebook:group-name ).

page

the tab of @notebook that is being detached

Returns

a Notebook that @page should be added to

source

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

source

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

source

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

source

pub fn emit_move_focus_out(&self, object: DirectionType)

source

pub 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

pub 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

pub 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

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

source

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

source

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

source

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

source

pub 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

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl Notebook

source

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

Appends a page to @self.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

Returns

the index (starting from 0) of the appended page in the notebook, or -1 if function fails

source

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

Appends a page to @self, specifying the widget to use as the label in the popup menu.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

the widget to use as a label for the page-switch menu, if that is enabled. If None, and @tab_label is a Label or None, then the menu label will be a newly created label with the same text as @tab_label; if @tab_label is not a Label, @menu_label must be specified if the page-switch menu is to be used.

Returns

the index (starting from 0) of the appended page in the notebook, or -1 if function fails

source

pub fn current_page(&self) -> Option<u32>

Returns the page number of the current page.

Returns

the index (starting from 0) of the current page in the notebook. If the notebook has no pages, then -1 will be returned.

source

pub fn n_pages(&self) -> u32

Gets the number of pages in a notebook.

Returns

the number of pages in the notebook

source

pub fn nth_page(&self, page_num: Option<u32>) -> Option<Widget>

Returns the child widget contained in page number @page_num.

page_num

the index of a page in the notebook, or -1 to get the last page

Returns

the child widget, or None if @page_num is out of bounds

source

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

Insert a page into @self at the given position.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

position

the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages

Returns

the index (starting from 0) of the inserted page in the notebook, or -1 if function fails

source

pub fn insert_page_menu( &self, child: &impl IsA<Widget>, tab_label: Option<&impl IsA<Widget>>, menu_label: Option<&impl IsA<Widget>>, position: Option<u32> ) -> u32

Insert a page into @self at the given position, specifying the widget to use as the label in the popup menu.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

the widget to use as a label for the page-switch menu, if that is enabled. If None, and @tab_label is a Label or None, then the menu label will be a newly created label with the same text as @tab_label; if @tab_label is not a Label, @menu_label must be specified if the page-switch menu is to be used.

position

the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.

Returns

the index (starting from 0) of the inserted page in the notebook

source

pub fn page_num(&self, child: &impl IsA<Widget>) -> Option<u32>

Finds the index of the page which contains the given child widget.

child

a Widget

Returns

the index of the page containing @child, or -1 if @child is not in the notebook

source

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

Prepends a page to @self.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

Returns

the index (starting from 0) of the prepended page in the notebook, or -1 if function fails

source

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

Prepends a page to @self, specifying the widget to use as the label in the popup menu.

child

the Widget to use as the contents of the page

tab_label

the Widget to be used as the label for the page, or None to use the default label, “page N”

the widget to use as a label for the page-switch menu, if that is enabled. If None, and @tab_label is a Label or None, then the menu label will be a newly created label with the same text as @tab_label; if @tab_label is not a Label, @menu_label must be specified if the page-switch menu is to be used.

Returns

the index (starting from 0) of the prepended page in the notebook, or -1 if function fails

source

pub fn remove_page(&self, page_num: Option<u32>)

Removes a page from the notebook given its index in the notebook.

page_num

the index of a notebook page, starting from 0. If -1, the last page will be removed.

source

pub fn reorder_child(&self, child: &impl IsA<Widget>, position: Option<u32>)

Reorders the page containing @child, so that it appears in position @position.

If @position is greater than or equal to the number of children in the list or negative, @child will be moved to the end of the list.

child

the child to move

position

the new position, or -1 to move to the end

source

pub fn set_current_page(&self, page_num: Option<u32>)

Switches to the page number @page_num.

Note that due to historical reasons, GtkNotebook refuses to switch to a page unless the child widget is visible. Therefore, it is recommended to show child widgets before adding them to a notebook.

page_num

index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the notebook, nothing will be done.

Trait Implementations§

source§

impl Clone for Notebook

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Notebook

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Notebook

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Notebook

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Notebook

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Notebook

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for Notebook

source§

impl<OT: ObjectType> PartialEq<OT> for Notebook

source§

fn eq(&self, other: &OT) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for Notebook

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for Notebook

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for Notebook

source§

impl IsA<Accessible> for Notebook

source§

impl IsA<Buildable> for Notebook

source§

impl IsA<ConstraintTarget> for Notebook

source§

impl IsA<Widget> for Notebook

Auto Trait Implementations§

Blanket Implementations§

source§

impl<O> AccessibleExtManual for Owhere O: IsA<Accessible>,

source§

fn update_property(&self, properties: &[Property<'_>])

Updates an array of accessible properties. Read more
source§

fn update_relation(&self, relations: &[Relation<'_>])

Updates an array of accessible relations. Read more
source§

fn update_state(&self, states: &[State])

Updates an array of accessible states. Read more
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Cast for Twhere T: ObjectType,

source§

fn upcast<T>(self) -> Twhere T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &Twhere T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>where T: ObjectType, Self: CanDowncast<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>where T: ObjectType, Self: CanDowncast<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

fn dynamic_cast<T>(self) -> Result<T, Self>where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

unsafe fn unsafe_cast<T>(self) -> Twhere T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_num_as_vec( ptr: *const GPtrArray, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_full_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T, Global>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_num_as_vec( ptr: *const GSList, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GSList, _: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_full_num_as_vec( _: *const GSList, _: usize ) -> Vec<T, Global>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

source§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T, Global>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T, Global>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T, Global>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T, Global>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T, Global>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T, Global>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T, Global>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T, Global>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T, Global>

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<U> IsSubclassableExt for Uwhere U: IsClass + ParentClassIs,

source§

impl<T> ObjectExt for Twhere T: ObjectType,

source§

fn is<U>(&self) -> boolwhere U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn try_set_property<V>( &self, property_name: &str, value: V ) -> Result<(), BoolError>where V: ToValue,

Similar to Self::set_property but fails instead of panicking.
source§

fn set_property<V>(&self, property_name: &str, value: V)where V: ToValue,

Sets the property property_name of the object to value value. Read more
source§

fn try_set_property_from_value( &self, property_name: &str, value: &Value ) -> Result<(), BoolError>

Similar to Self::set_property but fails instead of panicking.
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn try_set_properties( &self, property_values: &[(&str, &dyn ToValue)] ) -> Result<(), BoolError>

Similar to Self::set_properties but fails instead of panicking.
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn try_set_properties_from_value( &self, property_values: &[(&str, Value)] ) -> Result<(), BoolError>

Similar to Self::set_properties_from_value but fails instead of panicking.
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn try_property<V>(&self, property_name: &str) -> Result<V, BoolError>where V: for<'b> FromValue<'b> + 'static,

Similar to Self::property but fails instead of panicking.
source§

fn property<V>(&self, property_name: &str) -> Vwhere V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn try_property_value(&self, property_name: &str) -> Result<Value, BoolError>

Similar to Self::property_value but fails instead of panicking.
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn try_connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Similar to Self::connect but fails instead of panicking.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn try_connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Similar to Self::connect_id but fails instead of panicking.
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn try_connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + 'static,

Similar to Self::connect_local but fails instead of panicking.
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn try_connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value> + 'static,

Similar to Self::connect_local_id but fails instead of panicking.
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn try_connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value>,

Similar to Self::connect_unsafe but fails instead of panicking.
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn try_connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> Result<SignalHandlerId, BoolError>where F: Fn(&[Value]) -> Option<Value>,

Similar to Self::connect_unsafe_id but fails instead of panicking.
source§

fn try_connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> Result<SignalHandlerId, BoolError>

Similar to Self::connect_closure but fails instead of panicking.
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn try_connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> Result<SignalHandlerId, BoolError>

Similar to Self::connect_closure_id but fails instead of panicking.
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to Closure::invoke.
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn try_emit<R>( &self, signal_id: SignalId, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,

Similar to Self::emit but fails instead of panicking.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,

Emit signal by signal id. Read more
source§

fn try_emit_with_values( &self, signal_id: SignalId, args: &[Value] ) -> Result<Option<Value>, BoolError>

Similar to Self::emit_with_values but fails instead of panicking.
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn try_emit_by_name<R>( &self, signal_name: &str, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,

Similar to Self::emit_by_name but fails instead of panicking.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,

Emit signal by its name. Read more
source§

fn try_emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Result<Option<Value>, BoolError>

Similar to Self::emit_by_name_with_values but fails instead of panicking.
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Option<Value>

Emit signal by its name. Read more
source§

fn try_emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,

Similar to Self::emit_by_name_with_details but fails instead of panicking.
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,

Emit signal by its name with details. Read more
source§

fn try_emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Result<Option<Value>, BoolError>

Similar to Self::emit_by_name_with_details_and_values but fails instead of panicking.
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn try_emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> Result<R, BoolError>where R: TryFromClosureReturnValue,

Similar to Self::emit_with_details but fails instead of panicking.
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,

Emit signal by signal id with details. Read more
source§

fn try_emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Result<Option<Value>, BoolError>

Similar to Self::emit_with_details_and_values but fails instead of panicking.
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn bind_property<O, 'a>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str ) -> BindingBuilder<'a>where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

impl<T> StaticTypeExt for Twhere T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToClosureReturnValue for Twhere T: ToValue,

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for Twhere T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<Super, Sub> CanDowncast<Sub> for Superwhere Super: IsA<Super>, Sub: IsA<Super>,

source§

impl<'a, T, C> FromValueOptional<'a> for Twhere T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,