| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.UI.FLTK.Theme.Light.Table
Description
A word on the table widgets, the theme does provide overrides of [Table](http:/hackage.haskell.orgpackagefltkhsdocs/Graphics-UI-FLTK-LowLevel-Table.html) and [TableRow](http:/hackage.haskell.orgpackagefltkhsdocs/Graphics-UI-FLTK-LowLevel-TableRow.html) but they are pretty lowlevel widgets requiring you to supply column/row/cell drawing functions. The functions below draw nicely themed cells and can be passed the Table/TableRow constructors.
The idea is they are used in the generic table drawing cell function at each drawing context, something like:
...
table <- tableRowNew
(Rectangle ...)
(Just "My Table")
Nothing
drawCell
defaultCustomWidgetFuncs
defaultCustomTableFuncs
...
drawCell :: (?assets :: Assets) => Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ()
drawCell t tcontext ... =
case tcontext of
ContextRowHeader -> do
...
drawHeader ...
ContextColHeader -> do
...
drawHeader ...
ContextCell -> do
...
drawDataCell ...
_ -> return ()
Synopsis
- drawDataCell :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO ()
- drawHeader :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO ()
- drawHeaderWithImage :: (Parent a Image, ?assets :: Assets) => Color -> Alignments -> Text -> Ref a -> Rectangle -> IO ()
- tableCustom :: Rectangle -> Maybe Text -> Maybe (Ref Table -> IO ()) -> (Ref Table -> TableContext -> TableCoordinate -> Rectangle -> IO ()) -> CustomWidgetFuncs Table -> CustomTableFuncs Table -> IO (Ref Table)
- tableRowNew :: Rectangle -> Maybe Text -> Maybe (Ref TableRow -> IO ()) -> (Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ()) -> CustomWidgetFuncs TableRow -> CustomTableFuncs TableRow -> IO (Ref TableRow)
Documentation
drawDataCell :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO () Source #
Custom cell drawing function
drawHeader :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO () Source #
drawHeaderWithImage :: (Parent a Image, ?assets :: Assets) => Color -> Alignments -> Text -> Ref a -> Rectangle -> IO () Source #
Arguments
| :: Rectangle | Bounds of this table |
| -> Maybe Text | Optional label |
| -> Maybe (Ref Table -> IO ()) | Optional custom table drawing function |
| -> (Ref Table -> TableContext -> TableCoordinate -> Rectangle -> IO ()) | Custom table cell drawing function |
| -> CustomWidgetFuncs Table | Widget overrides |
| -> CustomTableFuncs Table | Table overrides |
| -> IO (Ref Table) |
Arguments
| :: Rectangle | Bounds of this table |
| -> Maybe Text | Optional label |
| -> Maybe (Ref TableRow -> IO ()) | Optional custom table drawing function |
| -> (Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ()) | Custom table cell drawing function |
| -> CustomWidgetFuncs TableRow | Widget overrides |
| -> CustomTableFuncs TableRow | Table overrides |
| -> IO (Ref TableRow) |