vty-ui-1.9: An interactive terminal user interface library for Vty

Safe HaskellNone
LanguageHaskell98

Graphics.Vty.Widgets.DirBrowser

Description

This module provides a directory browser interface widget. For full details, please see the Vty-ui User's Manual.

Synopsis

Documentation

data BrowserSkin Source

The collection of attributes and annotations used to determine the browser's visual appearance.

Constructors

BrowserSkin 

Fields

browserHeaderAttr :: Attr

Used for the header and footer areas of the interface.

browserUnfocusedSelAttr :: Attr

Used for the selected entry when the browser does not have focus.

browserErrorAttr :: Attr

Used for the browser's error-reporting area.

browserDirAttr :: Attr

Used for directory entries.

browserLinkAttr :: Attr

Used for symbolic link entries.

browserBlockDevAttr :: Attr

Used for block device entries.

browserNamedPipeAttr :: Attr

Used for named pipe entries.

browserCharDevAttr :: Attr

Used for device entries.

browserSockAttr :: Attr

Used for socket entries.

browserShowHeader :: Bool

Whether the browser header should be shown.

browserShowFooter :: Bool

Whether the browser footer should be shown.

browserCustomAnnotations :: [(FilePath -> FileStatus -> Bool, FilePath -> FileStatus -> IO Text, Attr)]

File annotations.

browserIncludeEntry :: FilePath -> FileStatus -> Bool

The predicate which determines which entries get listed in the browser.

newDirBrowser :: BrowserSkin -> IO (DirBrowser, Widget FocusGroup) Source

Create a directory browser widget with the specified skin. Returns the browser itself along with its focus group.

withAnnotations :: BrowserSkin -> [(FilePath -> FileStatus -> Bool, FilePath -> FileStatus -> IO Text, Attr)] -> BrowserSkin Source

Apply annotations to a browser skin.

setDirBrowserPath :: DirBrowser -> FilePath -> IO () Source

Set the browser's current path.

getDirBrowserPath :: DirBrowser -> IO FilePath Source

Get the browser's current path.

defaultBrowserSkin :: BrowserSkin Source

The default browser skin with (hopefully) sane attribute defaults.

onBrowseAccept :: DirBrowser -> (FilePath -> IO ()) -> IO () Source

Register handlers to be invoked when the user makes a selection.

onBrowseCancel :: DirBrowser -> (FilePath -> IO ()) -> IO () Source

Register handlers to be invoked when the user cancels browsing.

onBrowserPathChange :: DirBrowser -> (FilePath -> IO ()) -> IO () Source

Register handlers to be invoked when the browser's path changes.

reportBrowserError :: DirBrowser -> Text -> IO () Source

Report an error in the browser's error-reporting area. Useful for reporting application-specific errors with the user's file selection.

refreshBrowser :: DirBrowser -> IO () Source

Refresh the browser by reloading and displaying the contents of the browser's current path.