Notebook¶
Notebook is a view that can hold only children of type Element. With this
restriction, there is no limitation in number of children it can hold.
-
class
Aduct.Views.Notebook.Notebook(**kwargs)¶ Makes a notebook based on given properties. Its CSS name is aduct-notebook.
Parameters: - **kwargs – The values to be passed to
Gtk.Notebookfrom whichNotebookis made. - Signals –
- action-clicked
- Emitted with an integer when action button of
selfis clicked. The integer is 1, 2, 3 for LMB, MMB, RMB respectively.
-
add_child(child, position=-1)¶ Adds the child
self.Parameters: child ( Element) – The child to be added toself.Raises: TypeError– Raised whenchildis not aElement.
-
change_child_label(child)¶ Changes the tab label for existing child.
The text for new label is taken as the name of child of
child(Aduct.Element.child_name). It is set to No child when child has no name for its child (Aduct.Element.child_name is None).Parameters: child ( Element) – The child whose tab label has to be changed.
Gets the action button at given position.
Parameters: pack_type ( Gtk.PackType) – The position from which action button has to retrieved.Returns: The action button of selforNoneifselfhas no action button.Return type: Gtk.ButtonorNone
Gets the number of action buttons present.
Returns: The number of action buttons. Return type: int
-
get_props()¶ Gets the interface properties.
Returns: A dictionary with interface properties. Return type: dict
-
get_tab(child)¶ Gets a tab label for child.
The text for new label is taken as the name of child of
child(Aduct.Element.child_name). It is set to No child when child has no name for its child (Aduct.Element.child_name is None). Based on position of tabs inself, the orientation of text in the label also varies.Parameters: child ( Element) – The child which requires a tab label.Returns: Label with text determined from child.Return type: Gtk.Label
-
remove_child(child)¶ Removes the given child from
self.Parameters: child ( Element) – The child which has to be removed fromself.Raises: ValueError– Raised whenchildis not present inself.
-
replace_child(old_child, new_child)¶ Replaces the existing child with a new child.
Parameters: Raises:
Sets the action button to notebook.
Parameters: - action_button (
Gtk.Button) – The button to be added to notebook. It need not be aGtk.Buttonactually, it could be any widget that can handle button-press-event. - pack_type (
Gtk.PackType) – The position of the action button.
- action_button (
-
set_from_props(props)¶ Sets the interface from given properties.
Parameters: props ( dict) – The dictionary containig properties of interface.Raises: ValueError– Raised when there is a mismatch of number of action buttons in properties andself.
-
type¶ Used by autodoc_mock_imports.
- **kwargs – The values to be passed to