gtk-0.11.0: Binding to the Gtk+ graphical user interface library.ContentsIndex
Graphics.UI.Gtk.Gdk.Cursor
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Types
Enums
Constructors
Methods
Description
Cursors | Standard and pixmap cursors.
Synopsis
newtype Cursor = Cursor (ForeignPtr Cursor)
data CursorType
= XCursor
| Arrow
| BasedArrowDown
| BasedArrowUp
| Boat
| Bogosity
| BottomLeftCorner
| BottomRightCorner
| BottomSide
| BottomTee
| BoxSpiral
| CenterPtr
| Circle
| Clock
| CoffeeMug
| Cross
| CrossReverse
| Crosshair
| DiamondCross
| Dot
| Dotbox
| DoubleArrow
| DraftLarge
| DraftSmall
| DrapedBox
| Exchange
| Fleur
| Gobbler
| Gumby
| Hand1
| Hand2
| Heart
| Icon
| IronCross
| LeftPtr
| LeftSide
| LeftTee
| Leftbutton
| LlAngle
| LrAngle
| Man
| Middlebutton
| Mouse
| Pencil
| Pirate
| Plus
| QuestionArrow
| RightPtr
| RightSide
| RightTee
| Rightbutton
| RtlLogo
| Sailboat
| SbDownArrow
| SbHDoubleArrow
| SbLeftArrow
| SbRightArrow
| SbUpArrow
| SbVDoubleArrow
| Shuttle
| Sizing
| Spider
| Spraycan
| Star
| Target
| Tcross
| TopLeftArrow
| TopLeftCorner
| TopRightCorner
| TopSide
| TopTee
| Trek
| UlAngle
| Umbrella
| UrAngle
| Watch
| Xterm
| LastCursor
| BlankCursor
| CursorIsPixmap
cursorNew :: CursorType -> IO Cursor
cursorNewFromPixmap :: Pixmap -> Pixmap -> Color -> Color -> Int -> Int -> IO Cursor
cursorNewFromPixbuf :: Display -> Pixbuf -> Int -> Int -> IO Cursor
cursorNewFromName :: Display -> String -> IO (Maybe Cursor)
cursorNewForDisplay :: Display -> CursorType -> IO Cursor
cursorGetDisplay :: Cursor -> IO Display
cursorGetImage :: Cursor -> IO (Maybe Pixbuf)
Types
newtype Cursor
Constructors
Cursor (ForeignPtr Cursor)
Enums
data CursorType
Cursor types.
Constructors
XCursor
Arrow
BasedArrowDown
BasedArrowUp
Boat
Bogosity
BottomLeftCorner
BottomRightCorner
BottomSide
BottomTee
BoxSpiral
CenterPtr
Circle
Clock
CoffeeMug
Cross
CrossReverse
Crosshair
DiamondCross
Dot
Dotbox
DoubleArrow
DraftLarge
DraftSmall
DrapedBox
Exchange
Fleur
Gobbler
Gumby
Hand1
Hand2
Heart
Icon
IronCross
LeftPtr
LeftSide
LeftTee
Leftbutton
LlAngle
LrAngle
Man
Middlebutton
Mouse
Pencil
Pirate
Plus
QuestionArrow
RightPtr
RightSide
RightTee
Rightbutton
RtlLogo
Sailboat
SbDownArrow
SbHDoubleArrow
SbLeftArrow
SbRightArrow
SbUpArrow
SbVDoubleArrow
Shuttle
Sizing
Spider
Spraycan
Star
Target
Tcross
TopLeftArrow
TopLeftCorner
TopRightCorner
TopSide
TopTee
Trek
UlAngle
Umbrella
UrAngle
Watch
Xterm
LastCursor
BlankCursor
CursorIsPixmap
show/hide Instances
Constructors
cursorNew
:: CursorTypecursorType cursor to create
-> IO Cursorreturn a new Cursor
Creates a new cursor from the set of builtin cursors for the default display. See cursorNewForDisplay. To make the cursor invisible, use BlankCursor.
Methods
cursorNewFromPixmap
:: Pixmapsource - the pixmap specifying the cursor.
-> Pixmapmask - the pixmap specifying the mask, which must be the same size as source.
-> Colorfg - the foreground color, used for the bits in the source which are 1. The color does not have to be allocated first.
-> Colorbg - the background color, used for the bits in the source which are 0. The color does not have to be allocated first.
-> Intx - the horizontal offset of the 'hotspot' of the cursor.
-> Inty - the vertical offset of the 'hotspot' of the cursor.
-> IO Cursor
Creates a new cursor from a given pixmap and mask. Both the pixmap and mask must have a depth of 1 (i.e. each pixel has only 2 values - on or off). The standard cursor size is 16 by 16 pixels.
cursorNewFromPixbuf
:: Displaydisplay the Display for which the cursor will be created
-> Pixbufpixbuf the Pixbuf containing the cursor image
-> Intx the horizontal offset of the hotspot of the cursor.
-> Inty the vertical offset of the hotspot of the cursor.
-> IO Cursorreturn a new Cursor.

Creates a new cursor from a pixbuf. Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions displaySupportsCursorAlpha and displaySupportsCursorColor can be used to determine whether RGBA cursors are supported; displayGetDefaultCursorSize and displayGetMaximalCursorSize give information about cursor sizes.

On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.

cursorNewFromName
:: Displaydisplay the Display for which the cursor will be created
-> Stringname the name of the cursor
-> IO (Maybe Cursor)return a new Cursor, or Nothing if there is no cursor with the given name
Creates a new cursor by looking up name in the current cursor theme.
cursorNewForDisplay
:: Displaydisplay the Display for which the cursor will be created
-> CursorTypecursorType cursor to create
-> IO Cursorreturn a new Cursor
Creates a new cursor from the set of builtin cursors.
cursorGetDisplay
:: Cursorcursor Cursor
-> IO Displayreturn the Display associated to cursor
Returns the display on which the GdkCursor is defined.
cursorGetImage
:: Cursorcursor Cursor
-> IO (Maybe Pixbuf)a Pixbuf representing cursor, or Nothing
Returns a Pixbuf with the image used to display the cursor. Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case, Nothing is returned.
Produced by Haddock version 2.4.2