gtk-helpers-0.0.9.1: A collection of auxiliary operations and widgets related to Gtk+

Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Helpers.ModelViewNotebookSync

Description

This module provides functions to alter the view in a notebook and a maybewidget with a notebook inside based on what is selected in a model view (icon view, list view, tree view)

This pattern appears very often in my programs. I like to use model views to let the user choose what to see (instead of using the tab pages).

Synopsis

Documentation

modelViewNotebookSync :: (ViewWithPathSelection a c, NotebookClass b) => a -> b -> (TreePath -> Int) -> IO () Source #

Keeps the page of a notebook in sync with the selection in a model view. It uses an auxiliary function to determine which page to select.

modelViewNotebookSyncId :: (ViewWithPathSelection a c, NotebookClass b) => a -> b -> IO () Source #

Keeps the page of a notebook in sync with the selection in a model view. It selects the page with the same number as the element selected in the model view. If there's more than one selection, or if the model view is not flat and the selected element is not at the first level, then it selects nothing.

modelViewMaybeNotebookSync :: (ViewWithPathSelection a c, NotebookClass b) => a -> MaybeWidget b -> (TreePath -> Maybe Int) -> IO () Source #

Keeps the page of a notebook inside a maybe widget in sync with the selection in a model view.

It uses an auxiliary function to determine which page to select. If the function returns Nothing, then the maybe widget is deactivated.

modelViewMaybeNotebookSyncId :: (ViewWithPathSelection a c, NotebookClass b) => a -> MaybeWidget b -> IO () Source #

Keeps the page of a notebook inside a maybe widget in sync with the selection in a model view.

It selects the page with the same number as the element selected in the model view. If there's more than one selection, or if the model view is not flat and the selected element is not at the first level, then it selects nothing.