gtk-0.13.9: Binding to the Gtk+ graphical user interface library.

Maintainergtk2hs-users@lists.sourceforge.net
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.ModelView.IconView

Contents

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

Constructors

iconViewNew :: IO IconView Source

Creates a new IconView widget

iconViewNewWithModel Source

Arguments

:: 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 Source

Arguments

:: (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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO (Maybe TreeModel)

returns a TreeModel, or Nothing if none is currently being used.

Returns the model the IconView is based on. Returns Nothing if the model is unset.

iconViewSetTextColumn Source

Arguments

:: (IconViewClass self, GlibString string) 
=> 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 Source

Arguments

:: (IconViewClass self, GlibString string) 
=> self 
-> IO (ColumnId row string)

returns the text column, or invalidColumnId if it's unset.

Returns the column with text for iconView.

iconViewSetMarkupColumn Source

Arguments

:: (IconViewClass self, GlibString markup) 
=> 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 Markup). A text source that is set using iconViewSetTextSource is ignored once a markup source is set.

iconViewGetMarkupColumn Source

Arguments

:: (IconViewClass self, GlibString markup) 
=> self 
-> IO (ColumnId row markup)

returns the markup column, or invalidColumnId if it's unset.

Returns the column with markup text for iconView.

iconViewSetPixbufColumn Source

Arguments

:: IconViewClass self 
=> self 
-> ColumnId row Pixbuf

column - A column in the currently used model.

-> IO () 

Sets the column of the Pixbuf for entries in the IconView.

iconViewGetPixbufColumn Source

Arguments

:: IconViewClass self 
=> self 
-> IO (ColumnId row Pixbuf)

returns the pixbuf column, or invalidColumnId if it's unset.

Returns the column with pixbufs for iconView.

iconViewGetPathAtPos Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> SelectionMode

mode - The selection mode

-> IO () 

Sets the selection mode of the iconView.

iconViewGetSelectionMode Source

Arguments

:: IconViewClass self 
=> self 
-> IO SelectionMode

returns the current selection mode

Gets the selection mode of the iconView.

iconViewSetOrientation Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the number of columns, or -1

Returns the value of the ::columns property.

iconViewSetItemWidth Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the width of a single item, or -1

Returns the value of the ::item-width property.

iconViewSetSpacing Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the space between cells

Returns the value of the ::spacing property.

iconViewSetRowSpacing Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the space between rows

Returns the value of the ::row-spacing property.

iconViewSetColumnSpacing Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the space between columns

Returns the value of the ::column-spacing property.

iconViewSetMargin Source

Arguments

:: 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 Source

Arguments

:: IconViewClass self 
=> self 
-> IO Int

returns the space at the borders

Returns the value of the ::margin property.

iconViewSelectPath Source

Arguments

:: IconViewClass self 
=> self 
-> TreePath

path - The TreePath to be selected.

-> IO () 

Selects the row at path.

iconViewUnselectPath Source

Arguments

:: IconViewClass self 
=> self 
-> TreePath

path - The TreePath to be unselected.

-> IO () 

Unselects the row at path.

iconViewPathIsSelected Source

Arguments

:: 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 Source

Arguments

:: 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 () Source

Selects all the icons. iconView must has its selection mode set to SelectionMultiple.

iconViewUnselectAll :: IconViewClass self => self -> IO () Source

Unselects all the icons.

iconViewItemActivated Source

Arguments

:: IconViewClass self 
=> self 
-> TreePath

path - The TreePath to be activated

-> IO () 

Activates the item determined by path.

iconViewGetItemAtPos Source

Arguments

:: 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 Source

Arguments

:: (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 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 Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: 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 Source

Arguments

:: 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 () 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

iconViewSetReorderable Source

Arguments

:: 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 Source

Arguments

:: 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

iconViewGetItemRow Source

Arguments

:: IconViewClass self 
=> self 
-> TreePath

path the TreePath of the item

-> 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

iconViewGetItemColumn Source

Arguments

:: IconViewClass self 
=> self 
-> TreePath

path the TreePath of the item

-> 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 SelectionMode Source

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, GlibString string) => 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, GlibString markup) => 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 Int Source

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 Source

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 Source

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 Source

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 Source

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 Source

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 Source

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 Source

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 Orientation Source

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.