| gtk-0.11.0: Binding to the Gtk+ graphical user interface library. | Contents | Index |
|
Graphics.UI.Gtk.ModelView.IconView | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
A widget which displays a list of icons in a grid
- Module available since Gtk+ version 2.6
|
|
Synopsis |
|
|
|
|
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
|
|
| GObject
| +----Object
| +----Widget
| +----Container
| +----IconView
|
|
Types
|
|
data IconView |
Instances | |
|
|
class ContainerClass o => IconViewClass o |
| Instances | |
|
|
castToIconView :: GObjectClass obj => obj -> IconView |
|
gTypeIconView :: GType |
|
toIconView :: IconViewClass o => o -> IconView |
|
Constructors
|
|
iconViewNew :: IO IconView |
Creates a new IconView widget
|
|
iconViewNewWithModel |
:: TreeModelClass model | | => model | model - The 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
|
|
iconViewSetModel |
:: (IconViewClass self, TreeModelClass model) | | => self | | -> Maybe model | model - The 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.
|
|
|
iconViewGetModel |
|
|
iconViewSetTextColumn |
:: IconViewClass self | | => self | | -> ColumnId row String | column - A column in the currently used model.
| -> 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.
|
|
|
iconViewGetTextColumn |
|
|
iconViewSetMarkupColumn |
:: IconViewClass self | | => self | | -> ColumnId row Markup | column - A column in the currently used model.
| -> IO () | | Sets the column of the text for entries in the IconView as a markup
string (see Graphics.Rendering.Pango.Markup). A text source that is set
using iconViewSetTextSource is ignored once a markup source is set.
|
|
|
iconViewGetMarkupColumn |
|
|
iconViewSetPixbufColumn |
|
|
iconViewGetPixbufColumn |
|
|
iconViewGetPathAtPos |
:: IconViewClass self | | => self | | -> Int | x - The x position to be identified
| -> Int | y - The y position to be identified
| -> IO TreePath | returns The TreePath corresponding to the icon or []
if no icon exists at that position.
| 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.
|
|
|
iconViewSelectedForeach |
:: IconViewClass self | | => self | | -> TreePath -> IO () | (path -> ...) - The funcion to call for each
selected icon.
| -> IO () | | Calls a function for each selected icon. Note that the model or selection
cannot be modified from within this function.
|
|
|
iconViewSetSelectionMode |
|
|
iconViewGetSelectionMode |
|
|
iconViewSetOrientation |
:: IconViewClass self | | => self | | -> Orientation | orientation - the relative position of texts and icons
| -> IO () | | Sets the ::orientation property which determines whether the labels are
drawn beside the icons instead of below.
|
|
|
iconViewGetOrientation |
:: 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.
|
|
|
iconViewSetColumns |
:: IconViewClass self | | => self | | -> Int | columns - the number of columns
| -> 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.
|
|
|
iconViewGetColumns |
:: IconViewClass self | | => self | | -> IO Int | returns the number of columns, or -1
| Returns the value of the ::columns property.
|
|
|
iconViewSetItemWidth |
:: IconViewClass self | | => self | | -> Int | itemWidth - the width for each item
| -> 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.
|
|
|
iconViewGetItemWidth |
:: IconViewClass self | | => self | | -> IO Int | returns the width of a single item, or -1
| Returns the value of the ::item-width property.
|
|
|
iconViewSetSpacing |
:: IconViewClass self | | => self | | -> Int | spacing - the spacing
| -> 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.
|
|
|
iconViewGetSpacing |
:: IconViewClass self | | => self | | -> IO Int | returns the space between cells
| Returns the value of the ::spacing property.
|
|
|
iconViewSetRowSpacing |
:: IconViewClass self | | => self | | -> Int | rowSpacing - the row spacing
| -> IO () | | Sets the ::row-spacing property which specifies the space which is
inserted between the rows of the icon view.
|
|
|
iconViewGetRowSpacing |
:: IconViewClass self | | => self | | -> IO Int | returns the space between rows
| Returns the value of the ::row-spacing property.
|
|
|
iconViewSetColumnSpacing |
:: IconViewClass self | | => self | | -> Int | columnSpacing - the column spacing
| -> IO () | | Sets the ::column-spacing property which specifies the space which is
inserted between the columns of the icon view.
|
|
|
iconViewGetColumnSpacing |
:: IconViewClass self | | => self | | -> IO Int | returns the space between columns
| Returns the value of the ::column-spacing property.
|
|
|
iconViewSetMargin |
:: IconViewClass self | | => self | | -> Int | margin - the margin
| -> IO () | | Sets the ::margin property which specifies the space which is inserted at
the top, bottom, left and right of the icon view.
|
|
|
iconViewGetMargin |
:: IconViewClass self | | => self | | -> IO Int | returns the space at the borders
| Returns the value of the ::margin property.
|
|
|
iconViewSelectPath |
|
|
iconViewUnselectPath |
|
|
iconViewPathIsSelected |
:: IconViewClass self | | => self | | -> TreePath | path - A TreePath to check selection on.
| -> IO Bool | returns True if path is selected.
| Returns True if the icon pointed to by path is currently selected. If
icon does not point to a valid location, False is returned.
|
|
|
iconViewGetSelectedItems |
:: IconViewClass self | | => self | | -> IO [TreePath] | returns a list of TreePaths, one for each selected row.
| 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 TreeRowReferences. To do
this, you can use treeRowReferenceNew.
|
|
|
iconViewSelectAll :: IconViewClass self => self -> IO () |
Selects all the icons. iconView must has its selection mode set to
SelectionMultiple.
|
|
iconViewUnselectAll :: IconViewClass self => self -> IO () |
Unselects all the icons.
|
|
iconViewItemActivated |
|
|
iconViewGetItemAtPos |
:: IconViewClass self | | => self | | -> Int | x - The x position to be identified
| -> Int | y - The y position to be identified
| -> 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
|
|
|
iconViewSetCursor |
:: (IconViewClass self, CellRendererClass cell) | | => self | | -> Either TreePath cell | the path or the cell
| -> Bool | startEditing - True if the specified cell should start
being edited.
| -> 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
Graphics.UI.Gtk.Abstract.Widget.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
|
|
|
iconViewGetCursor |
:: IconViewClass self | | => self | | -> IO (TreePath, Maybe CellRenderer) | returns a path to the cursor and a cell if the widget has the input focus
| 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
|
|
|
iconViewScrollToPath |
:: IconViewClass self | | => self | | -> TreePath | path - The path of the item to move to.
| -> Bool | useAlign - whether to use alignment arguments, or False.
| -> Float | rowAlign - The vertical alignment of the item specified by
path.
| -> Float | colAlign - The horizontal alignment of the item specified
by path.
| -> 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
|
|
|
iconViewGetVisibleRange |
:: IconViewClass self | | => self | | -> IO (Maybe (TreePath, TreePath)) | returns the first and last visible path, the return value
Nothing if every element is visible
| Retrieve the first and last visible path.
Note that there may be invisible paths inbetween.
- Available since Gtk+ version 2.8
|
|
|
iconViewEnableModelDragSource |
:: IconViewClass self | | => self | | -> [Modifier] | startButtonMask - Mask of allowed buttons
to start drag
| -> TargetList | targets - the list of targets that the
the view will support
| -> [DragAction] | actions - flags denoting the possible actions
for a drag from this widget
| -> IO () | | Turns iconView into a drag source for automatic DND.
- Available since Gtk+ version 2.10
|
|
|
iconViewEnableModelDragDest |
:: IconViewClass self | | => self | | -> TargetList | targets - the list of targets that the
the view will support
| -> [DragAction] | actions - flags denoting the possible actions
for a drop into this widget
| -> IO () | | Turns iconView into a drop destination for automatic DND.
- Available since Gtk+ version 2.10
|
|
|
iconViewUnsetModelDragSource :: IconViewClass self => self -> IO () |
Undoes the effect of iconViewEnableModelDragSource.
- Available since Gtk+ version 2.10
|
|
iconViewUnsetModelDragDest :: IconViewClass self => self -> IO () |
Undoes the effect of iconViewEnableModelDragDest.
- Available since Gtk+ version 2.10
|
|
iconViewSetReorderable |
:: IconViewClass self | | => self | | -> Bool | reorderable - True, if the list of items can be reordered.
| -> 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 and ListStore models. If ro
is True, 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 the
treeDragSourceRowDraggable
function in the default DND implementation of the model.
- Available since Gtk+ version 2.8
|
|
|
iconViewGetReorderable |
:: IconViewClass self | | => self | | -> IO Bool | returns True if the list can be reordered.
| Retrieves whether the user can reorder the list via drag-and-drop. See
iconViewSetReorderable.
- Available since Gtk+ version 2.8
|
|
|
Attributes
|
|
iconViewSelectionMode :: IconViewClass self => Attr self SelectionMode |
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) |
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) |
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) |
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) |
The model for the icon view.
|
|
iconViewColumns :: IconViewClass self => Attr self Int |
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 Int |
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 Int |
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 Int |
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 Int |
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 Int |
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 Orientation |
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 Bool |
The reorderable property specifies if the items can be reordered by DND.
Default value: False
- Available since Gtk+ version 2.8
|
|
Signals
|
|
setIconViewScrollAdjustments :: IconViewClass self => Signal self (Adjustment -> Adjustment -> IO ()) |
New scroll adjustment have been set for this widget.
|
|
itemActivated :: IconViewClass self => Signal self (TreePath -> IO ()) |
A specific element has been activated (by pressing enter or double clicking).
|
|
selectionChanged :: IconViewClass self => Signal self (IO ()) |
The selected item changed.
|
|
Produced by Haddock version 2.4.2 |