Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data TabbedWindow s m n a = TabbedWindow {
- twValue :: a
- twTemplate :: TabbedWindowTemplate s m n a
- twWindowWidth :: Int
- twWindowHeight :: Int
- data TabbedWindowEntry s m n a = TabbedWindowEntry {
- tweValue :: a
- tweRender :: a -> s -> Widget n
- tweHandleEvent :: a -> Event -> m ()
- tweTitle :: a -> Bool -> Text
- tweShowHandler :: a -> m ()
- data TabbedWindowTemplate s m n a = TabbedWindowTemplate {
- twtEntries :: [TabbedWindowEntry s m n a]
- twtTitle :: a -> Widget n
- tabbedWindow :: (Show a, Eq a) => a -> TabbedWindowTemplate s m n a -> (Int, Int) -> TabbedWindow s m n a
- getCurrentTabbedWindowEntry :: (Show a, Eq a) => TabbedWindow s m n a -> TabbedWindowEntry s m n a
- tabbedWindowNextTab :: (Monad m, Show a, Eq a) => TabbedWindow s m n a -> m (TabbedWindow s m n a)
- tabbedWindowPreviousTab :: (Monad m, Show a, Eq a) => TabbedWindow s m n a -> m (TabbedWindow s m n a)
- runTabShowHandlerFor :: (Eq a, Show a) => a -> TabbedWindow s m n a -> m ()
Documentation
data TabbedWindow s m n a Source #
An instantiated tab window. This is based on a template and tracks the state of the tabbed window (current tab).
Parameterized over an abstract handle type (a
) for the tabs so we
can give each a unique handle.
TabbedWindow | |
|
data TabbedWindowEntry s m n a Source #
An entry in a tabbed window corresponding to a tab and its content.
Parameterized over an abstract handle type (a
) for the tabs so we
can give each a unique handle.
TabbedWindowEntry | |
|
data TabbedWindowTemplate s m n a Source #
The definition of a tabbed window. Note that this does not track the *state* of the window; it merely provides a collection of tab window entries (see above). To track the state of a tabbed window, use a TabbedWindow.
Parameterized over an abstract handle type (a
) for the tabs so we
can give each a unique handle.
TabbedWindowTemplate | |
|
:: (Show a, Eq a) | |
=> a | The handle corresponding to the tab that should be selected initially. |
-> TabbedWindowTemplate s m n a | The template for the window to construct. |
-> (Int, Int) | The window dimensions (width, height). |
-> TabbedWindow s m n a |
Construct a new tabbed window from a template. This will raise an exception if the initially-selected tab does not exist in the window template, or if the window template has any duplicated tab handles.
Note that the caller is responsible for determining whether to call the initially-selected tab's on-show handler.
getCurrentTabbedWindowEntry :: (Show a, Eq a) => TabbedWindow s m n a -> TabbedWindowEntry s m n a Source #
Get the currently-selected tab entry for a tabbed window. Raise an exception if the window's selected tab handle is not found in its template (which is a bug in the tabbed window infrastructure).
tabbedWindowNextTab :: (Monad m, Show a, Eq a) => TabbedWindow s m n a -> m (TabbedWindow s m n a) Source #
Switch a tabbed window's selected tab to its next tab, cycling back to the first tab if the last tab is the selected tab. This also invokes the on-show handler for the newly-selected tab.
Note that this does nothing if the window has only one tab.
tabbedWindowPreviousTab :: (Monad m, Show a, Eq a) => TabbedWindow s m n a -> m (TabbedWindow s m n a) Source #
Switch a tabbed window's selected tab to its previous tab, cycling to the last tab if the first tab is the selected tab. This also invokes the on-show handler for the newly-selected tab.
Note that this does nothing if the window has only one tab.
runTabShowHandlerFor :: (Eq a, Show a) => a -> TabbedWindow s m n a -> m () Source #
Run the on-show handler for the window tab entry with the specified handle.