Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
A widget which displays a list of icons in a grid
- Module available since Gtk+ version 2.6
- data IconView
- class ContainerClass o => IconViewClass o
- castToIconView :: GObjectClass obj => obj -> IconView
- gTypeIconView :: GType
- toIconView :: IconViewClass o => o -> IconView
- iconViewNew :: IO IconView
- iconViewNewWithModel :: TreeModelClass model => model -> IO IconView
- iconViewSetModel :: (IconViewClass self, TreeModelClass model) => self -> Maybe model -> IO ()
- iconViewGetModel :: IconViewClass self => self -> IO (Maybe TreeModel)
- iconViewSetTextColumn :: IconViewClass self => self -> ColumnId row String -> IO ()
- iconViewGetTextColumn :: IconViewClass self => self -> IO (ColumnId row String)
- iconViewSetMarkupColumn :: IconViewClass self => self -> ColumnId row Markup -> IO ()
- iconViewGetMarkupColumn :: IconViewClass self => self -> IO (ColumnId row Markup)
- iconViewSetPixbufColumn :: IconViewClass self => self -> ColumnId row Pixbuf -> IO ()
- iconViewGetPixbufColumn :: IconViewClass self => self -> IO (ColumnId row Pixbuf)
- iconViewGetPathAtPos :: IconViewClass self => self -> Int -> Int -> IO TreePath
- iconViewSelectedForeach :: IconViewClass self => self -> (TreePath -> IO ()) -> IO ()
- iconViewSetSelectionMode :: IconViewClass self => self -> SelectionMode -> IO ()
- iconViewGetSelectionMode :: IconViewClass self => self -> IO SelectionMode
- iconViewSetOrientation :: IconViewClass self => self -> Orientation -> IO ()
- iconViewGetOrientation :: IconViewClass self => self -> IO Orientation
- iconViewSetColumns :: IconViewClass self => self -> Int -> IO ()
- iconViewGetColumns :: IconViewClass self => self -> IO Int
- iconViewSetItemWidth :: IconViewClass self => self -> Int -> IO ()
- iconViewGetItemWidth :: IconViewClass self => self -> IO Int
- iconViewSetSpacing :: IconViewClass self => self -> Int -> IO ()
- iconViewGetSpacing :: IconViewClass self => self -> IO Int
- iconViewSetRowSpacing :: IconViewClass self => self -> Int -> IO ()
- iconViewGetRowSpacing :: IconViewClass self => self -> IO Int
- iconViewSetColumnSpacing :: IconViewClass self => self -> Int -> IO ()
- iconViewGetColumnSpacing :: IconViewClass self => self -> IO Int
- iconViewSetMargin :: IconViewClass self => self -> Int -> IO ()
- iconViewGetMargin :: IconViewClass self => self -> IO Int
- iconViewSelectPath :: IconViewClass self => self -> TreePath -> IO ()
- iconViewUnselectPath :: IconViewClass self => self -> TreePath -> IO ()
- iconViewPathIsSelected :: IconViewClass self => self -> TreePath -> IO Bool
- iconViewGetSelectedItems :: IconViewClass self => self -> IO [TreePath]
- iconViewSelectAll :: IconViewClass self => self -> IO ()
- iconViewUnselectAll :: IconViewClass self => self -> IO ()
- iconViewItemActivated :: IconViewClass self => self -> TreePath -> IO ()
- iconViewGetItemAtPos :: IconViewClass self => self -> Int -> Int -> IO (Maybe (TreePath, CellRenderer))
- iconViewSetCursor :: (IconViewClass self, CellRendererClass cell) => self -> Either TreePath cell -> Bool -> IO ()
- iconViewGetCursor :: IconViewClass self => self -> IO (TreePath, Maybe CellRenderer)
- iconViewScrollToPath :: IconViewClass self => self -> TreePath -> Bool -> Float -> Float -> IO ()
- iconViewGetVisibleRange :: IconViewClass self => self -> IO (Maybe (TreePath, TreePath))
- iconViewEnableModelDragSource :: IconViewClass self => self -> [Modifier] -> TargetList -> [DragAction] -> IO ()
- iconViewEnableModelDragDest :: IconViewClass self => self -> TargetList -> [DragAction] -> IO ()
- iconViewUnsetModelDragSource :: IconViewClass self => self -> IO ()
- iconViewUnsetModelDragDest :: IconViewClass self => self -> IO ()
- iconViewSetReorderable :: IconViewClass self => self -> Bool -> IO ()
- iconViewGetReorderable :: IconViewClass self => self -> IO Bool
- iconViewGetItemRow :: IconViewClass self => self -> TreePath -> IO Int
- iconViewGetItemColumn :: IconViewClass self => self -> TreePath -> IO Int
- iconViewSelectionMode :: IconViewClass self => Attr self SelectionMode
- iconViewTextColumn :: IconViewClass self => Attr self (ColumnId row String)
- iconViewMarkupColumn :: IconViewClass self => Attr self (ColumnId row Markup)
- iconViewPixbufColumn :: IconViewClass self => Attr self (ColumnId row Pixbuf)
- iconViewModel :: (IconViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) (Maybe model)
- iconViewColumns :: IconViewClass self => Attr self Int
- iconViewItemWidth :: IconViewClass self => Attr self Int
- iconViewSpacing :: IconViewClass self => Attr self Int
- iconViewRowSpacing :: IconViewClass self => Attr self Int
- iconViewColumnSpacing :: IconViewClass self => Attr self Int
- iconViewMargin :: IconViewClass self => Attr self Int
- iconViewOrientation :: IconViewClass self => Attr self Orientation
- iconViewReorderable :: IconViewClass self => Attr self Bool
- iconViewItemOrientation :: IconViewClass self => Attr self Orientation
- setIconViewScrollAdjustments :: IconViewClass self => Signal self (Adjustment -> Adjustment -> IO ())
- itemActivated :: IconViewClass self => Signal self (TreePath -> IO ())
- selectionChanged :: IconViewClass self => Signal self (IO ())
Detail
IconView
provides an alternative view on a list model. It displays the
model as a grid of icons with labels. Like TreeView
, it allows to select
one or multiple items (depending on the selection mode, see
iconViewSetSelectionMode
). In addition to selection with the arrow keys,
IconView
supports rubberband selection, which is controlled by dragging
the pointer.
Class Hierarchy
Types
class ContainerClass o => IconViewClass o Source
castToIconView :: GObjectClass obj => obj -> IconViewSource
toIconView :: IconViewClass o => o -> IconViewSource
Constructors
iconViewNew :: IO IconViewSource
Creates a new IconView
widget
:: TreeModelClass model | |
=> model |
|
-> IO IconView |
Creates a new IconView
widget with the model model
and defines
how to extract a string and a pixbuf from the model.
Methods
:: (IconViewClass self, TreeModelClass model) | |
=> self | |
-> Maybe model |
|
-> IO () |
Sets the model for a IconView
. If the iconView
already has a model
set, it will remove it before setting the new model. If model
is
Nothing
, then it will unset the old model.
:: IconViewClass self | |
=> self | |
-> IO (Maybe TreeModel) | returns a |
Returns the model the IconView
is based on. Returns Nothing
if the
model is unset.
:: IconViewClass self | |
=> self | |
-> ColumnId row String |
|
-> IO () |
Sets the column of the text for entries in the IconView
. If a markup
source is set using iconViewSetMarkupSource
, then the text source is
ignored.
:: IconViewClass self | |
=> self | |
-> IO (ColumnId row String) | returns the text column, or |
Returns the column with text for iconView
.
:: IconViewClass self | |
=> self | |
-> ColumnId row Markup |
|
-> IO () |
:: IconViewClass self | |
=> self | |
-> IO (ColumnId row Markup) | returns the markup column, or |
Returns the column with markup text for iconView
.
:: IconViewClass self | |
=> self | |
-> ColumnId row Pixbuf |
|
-> IO () |
:: IconViewClass self | |
=> self | |
-> IO (ColumnId row Pixbuf) | returns the pixbuf column, or |
Returns the column with pixbufs for iconView
.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO TreePath | returns The |
Finds the path at the point (x
, y
), relative to widget coordinates.
See iconViewGetItemAtPos
, if you are also interested in the cell at the
specified position.
:: IconViewClass self | |
=> self | |
-> (TreePath -> IO ()) |
|
-> IO () |
Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.
iconViewSetSelectionModeSource
:: IconViewClass self | |
=> self | |
-> SelectionMode |
|
-> IO () |
Sets the selection mode of the iconView
.
iconViewGetSelectionModeSource
:: IconViewClass self | |
=> self | |
-> IO SelectionMode | returns the current selection mode |
Gets the selection mode of the iconView
.
:: IconViewClass self | |
=> self | |
-> Orientation |
|
-> IO () |
Sets the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
:: IconViewClass self | |
=> self | |
-> IO Orientation | returns the relative position of texts and icons |
Returns the value of the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::columns property which determines in how many columns the
icons are arranged. If columns
is -1, the number of columns will be chosen
automatically to fill the available area.
:: IconViewClass self | |
=> self | |
-> IO Int | returns the number of columns, or -1 |
Returns the value of the ::columns property.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::item-width property which specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
:: IconViewClass self | |
=> self | |
-> IO Int | returns the width of a single item, or -1 |
Returns the value of the ::item-width property.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::spacing property which specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
:: IconViewClass self | |
=> self | |
-> IO Int | returns the space between cells |
Returns the value of the ::spacing property.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.
:: IconViewClass self | |
=> self | |
-> IO Int | returns the space between rows |
Returns the value of the ::row-spacing property.
iconViewSetColumnSpacingSource
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.
iconViewGetColumnSpacingSource
:: IconViewClass self | |
=> self | |
-> IO Int | returns the space between columns |
Returns the value of the ::column-spacing property.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.
:: IconViewClass self | |
=> self | |
-> IO Int | returns the space at the borders |
Returns the value of the ::margin property.
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO () |
Selects the row at path
.
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO () |
Unselects the row at path
.
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO Bool | returns |
Returns True
if the icon pointed to by path
is currently selected. If
icon
does not point to a valid location, False
is returned.
iconViewGetSelectedItemsSource
:: IconViewClass self | |
=> self | |
-> IO [TreePath] | returns a list of |
Creates a list of paths of all selected items. Additionally, if you are
planning on modifying the model after calling this function, you may want
to convert the returned list into a list of TreeRowReference
s. To do
this, you can use treeRowReferenceNew
.
iconViewSelectAll :: IconViewClass self => self -> IO ()Source
Selects all the icons. iconView
must has its selection mode set to
SelectionMultiple
.
iconViewUnselectAll :: IconViewClass self => self -> IO ()Source
Unselects all the icons.
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO () |
Activates the item determined by path
.
:: IconViewClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO (Maybe (TreePath, CellRenderer)) |
Finds the path at the point (x
, y
), relative to widget coordinates.
In contrast to iconViewGetPathAtPos
, this function also obtains the cell
at the specified position.
- Available since Gtk+ version 2.8
:: (IconViewClass self, CellRendererClass cell) | |
=> self | |
-> Either TreePath cell | the path or the cell |
-> Bool |
|
-> IO () |
Given Left path
as argument , sets the current keyboard focus to be at
path
, and selects it. This is useful when you want to focus the user's
attention on a particular item. If Right cell
is given, then focus is
given to the cell specified by it. Additionally, if startEditing
is
True
, then editing should be started in the specified cell.
This function is often followed by
widgetGrabFocus
in order to give keyboard
focus to the widget. Please note that editing can only happen when the
widget is realized.
- Available since Gtk+ version 2.8
:: IconViewClass self | |
=> self | |
-> IO (TreePath, Maybe CellRenderer) | returns a |
Return a path
and a cell
with the current cursor path and cell. If the
cursor isn't currently set, then []
will be returned for the path
. If no cell currently has focus,
then cell
will be Nothing
.
- Available since Gtk+ version 2.8
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> Bool |
|
-> Float |
|
-> Float |
|
-> IO () |
Moves the alignments of iconView
to the position specified by path
.
rowAlign
determines where the row is placed, and colAlign
determines
where column
is placed. Both are expected to be between 0.0 and 1.0. 0.0
means left/top alignment, 1.0 means right/bottom alignment, 0.5 means
center.
If useAlign
is False
, then the alignment arguments are ignored, and the
tree does the minimum amount of work to scroll the item onto the screen.
This means that the item will be scrolled to the edge closest to its
current position. If the item is currently visible on the screen, nothing
is done.
This function only works if the model is set, and path
is a valid row on
the model. If the model changes before the iconView
is realized, the
centered path will be modified to reflect this change.
- Available since Gtk+ version 2.8
:: IconViewClass self | |
=> self | |
-> IO (Maybe (TreePath, TreePath)) | returns the first and last visible path, the return value
|
Retrieve the first and last visible path. Note that there may be invisible paths inbetween.
- Available since Gtk+ version 2.8
iconViewEnableModelDragSourceSource
:: IconViewClass self | |
=> self | |
-> [Modifier] |
|
-> TargetList |
|
-> [DragAction] |
|
-> IO () |
Turns iconView
into a drag source for automatic DND.
- Available since Gtk+ version 2.10
iconViewEnableModelDragDestSource
:: IconViewClass self | |
=> self | |
-> TargetList |
|
-> [DragAction] |
|
-> IO () |
Turns iconView
into a drop destination for automatic DND.
- Available since Gtk+ version 2.10
iconViewUnsetModelDragSource :: IconViewClass self => self -> IO ()Source
Undoes the effect of iconViewEnableModelDragSource
.
- Available since Gtk+ version 2.10
iconViewUnsetModelDragDest :: IconViewClass self => self -> IO ()Source
Undoes the effect of iconViewEnableModelDragDest
.
- Available since Gtk+ version 2.10
:: IconViewClass self | |
=> self | |
-> Bool |
|
-> IO () |
Check if icons can be moved around.
- Set whether the user can use drag and drop (DND) to reorder the rows in
the store. This works on both
TreeStore
andListStore
models. Ifro
isTrue
, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's signals. If you need to control which rows may be dragged or where rows may be dropped, you can override thetreeDragSourceRowDraggable
function in the default DND implementation of the model. - Available since Gtk+ version 2.8
:: IconViewClass self | |
=> self | |
-> IO Bool | returns |
Retrieves whether the user can reorder the list via drag-and-drop. See
iconViewSetReorderable
.
- Available since Gtk+ version 2.8
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO Int | returns The row in which the item is displayed |
Gets the row in which the item path is currently displayed. Row numbers start at 0.
- Available since Gtk+ version 2.22
:: IconViewClass self | |
=> self | |
-> TreePath |
|
-> IO Int | returns The column in which the item is displayed |
Gets the column in which the item path is currently displayed. Column numbers start at 0.
- Available since Gtk+ version 2.22
Attributes
iconViewSelectionMode :: IconViewClass self => Attr self SelectionModeSource
The ::selection-mode property specifies the selection mode of icon view.
If the mode is SelectionMultiple
, rubberband selection is enabled, for the
other modes, only keyboard selection is possible.
Default value: SelectionSingle
iconViewTextColumn :: IconViewClass self => Attr self (ColumnId row String)Source
The iconViewTextColumn
property contains the number of the model column
containing the texts which are displayed. If this property and the
iconViewMarkupColumn
property are both set to invalidColumnId
, no texts
are displayed.
Default value: invalidColumnId
iconViewMarkupColumn :: IconViewClass self => Attr self (ColumnId row Markup)Source
The iconViewMarkupColumn
property contains the number of the model column
containing markup information to be displayed. If this property and the
iconViewTextColumn
property are both set to column numbers, it overrides the text
column. If both are set to invalidColumnId
, no texts are displayed.
Default value: invalidColumnId
iconViewPixbufColumn :: IconViewClass self => Attr self (ColumnId row Pixbuf)Source
The iconViewPixbufColumn
property contains the number of the model column
containing the pixbufs which are displayed. Setting this property to
invalidColumnId
turns off the display of pixbufs.
Default value: invalidColumnId
iconViewModel :: (IconViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) (Maybe model)Source
The model for the icon view.
iconViewColumns :: IconViewClass self => Attr self IntSource
The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
Allowed values: >= -1
Default value: -1
iconViewItemWidth :: IconViewClass self => Attr self IntSource
The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
Allowed values: >= -1
Default value: -1
iconViewSpacing :: IconViewClass self => Attr self IntSource
The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
Allowed values: >= 0
Default value: 0
iconViewRowSpacing :: IconViewClass self => Attr self IntSource
The row-spacing property specifies the space which is inserted between the rows of the icon view.
Allowed values: >= 0
Default value: 6
iconViewColumnSpacing :: IconViewClass self => Attr self IntSource
The column-spacing property specifies the space which is inserted between the columns of the icon view.
Allowed values: >= 0
Default value: 6
iconViewMargin :: IconViewClass self => Attr self IntSource
The margin property specifies the space which is inserted at the edges of the icon view.
Allowed values: >= 0
Default value: 6
iconViewOrientation :: IconViewClass self => Attr self OrientationSource
The orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
Default value: OrientationVertical
iconViewReorderable :: IconViewClass self => Attr self BoolSource
The reorderable property specifies if the items can be reordered by DND.
Default value: False
- Available since Gtk+ version 2.8
iconViewItemOrientation :: IconViewClass self => Attr self OrientationSource
The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
Default value: OrientationVertical
- Available since Gtk+ version 2.22
Signals
setIconViewScrollAdjustments :: IconViewClass self => Signal self (Adjustment -> Adjustment -> IO ())Source
New scroll adjustment have been set for this widget.
itemActivated :: IconViewClass self => Signal self (TreePath -> IO ())Source
A specific element has been activated (by pressing enter or double clicking).
selectionChanged :: IconViewClass self => Signal self (IO ())Source
The selected item changed.