Trait gtk::prelude::NotebookExtManual
source · [−]pub trait NotebookExtManual: 'static {
Show 13 methods
fn append_page<T: IsA<Widget>, U: IsA<Widget>>(
&self,
child: &T,
tab_label: Option<&U>
) -> u32;
fn append_page_menu<T, U, V>(
&self,
child: &T,
tab_label: Option<&U>,
menu_label: Option<&V>
) -> u32
where
T: IsA<Widget>,
U: IsA<Widget>,
V: IsA<Widget>;
fn current_page(&self) -> Option<u32>;
fn n_pages(&self) -> u32;
fn nth_page(&self, page_num: Option<u32>) -> Option<Widget>;
fn insert_page<T, U>(
&self,
child: &T,
tab_label: Option<&U>,
position: Option<u32>
) -> u32
where
T: IsA<Widget>,
U: IsA<Widget>;
fn insert_page_menu<T, U, V>(
&self,
child: &T,
tab_label: Option<&U>,
menu_label: Option<&V>,
position: Option<u32>
) -> u32
where
T: IsA<Widget>,
U: IsA<Widget>,
V: IsA<Widget>;
fn page_num<T: IsA<Widget>>(&self, child: &T) -> Option<u32>;
fn prepend_page<T, U>(&self, child: &T, tab_label: Option<&U>) -> u32
where
T: IsA<Widget>,
U: IsA<Widget>;
fn prepend_page_menu<T, U, V>(
&self,
child: &T,
tab_label: Option<&U>,
menu_label: Option<&V>
) -> u32
where
T: IsA<Widget>,
U: IsA<Widget>,
V: IsA<Widget>;
fn remove_page(&self, page_num: Option<u32>);
fn reorder_child<T: IsA<Widget>>(&self, child: &T, position: Option<u32>);
fn set_current_page(&self, page_num: Option<u32>);
}
Required Methods
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”
menu_label
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
fn current_page(&self) -> Option<u32>
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.
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
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”
menu_label
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
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”
menu_label
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
fn remove_page(&self, page_num: Option<u32>)
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.
fn set_current_page(&self, page_num: Option<u32>)
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.