gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Misc.DrawingArea

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods

Description

A widget for custom user interface elements

Synopsis

- data DrawingArea
- class WidgetClass o => DrawingAreaClass o
- castToDrawingArea :: GObjectClass obj => obj -> DrawingArea
- gTypeDrawingArea :: GType
- toDrawingArea :: DrawingAreaClass o => o -> DrawingArea
- drawingAreaNew :: IO DrawingArea

# Detail

The `DrawingArea` widget is used for creating custom user interface elements. It's essentially a blank widget; you can draw on the `Drawable` returned by `drawingAreaGetDrawWindow`.

After creating a drawing area, the application may want to connect to:

- Mouse and button press signals to respond to input from the user.
- The `realize` signal to take any necessary actions when the widget is instantiated on a particular display. (Create GDK resources in response to this signal.)
- The `configureEvent` signal to take any necessary actions when the widget changes size.
- The `exposeEvent` signal to handle redrawing the contents of the widget.

Expose events are normally delivered when a drawing area first comes onscreen, or when it's covered by another window and then uncovered (exposed). You can also force an expose event by adding to the "damage region" of the drawing area's window; `widgetQueueDrawArea` and `windowInvalidateRect` are equally good ways to do this. You'll then get an expose event for the invalid region.

The available routines for drawing are documented on the GDK Drawing Primitives page.

To receive mouse events on a drawing area, you will need to enable them with `widgetAddEvents`. To receive keyboard events, you will need to set the `widgetCanFocus` attribute on the drawing area, and should probably draw some user-visible indication that the drawing area is focused.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----DrawingArea

# Types

data DrawingArea Source #

#### Instances

Instances details

Eq DrawingArea Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: DrawingArea -> DrawingArea -> Bool Source # (/=) :: DrawingArea -> DrawingArea -> Bool Source #
Ord DrawingArea Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: DrawingArea -> DrawingArea -> Ordering Source #

(<) :: DrawingArea -> DrawingArea -> Bool Source #

(<=) :: DrawingArea -> DrawingArea -> Bool Source #

(>) :: DrawingArea -> DrawingArea -> Bool Source #

(>=) :: DrawingArea -> DrawingArea -> Bool Source #

max :: DrawingArea -> DrawingArea -> DrawingArea Source #

min :: DrawingArea -> DrawingArea -> DrawingArea Source #

GObjectClass DrawingArea Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: DrawingArea -> GObject Source # unsafeCastGObject :: GObject -> DrawingArea Source #
DrawingAreaClass DrawingArea Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass DrawingArea Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class WidgetClass o => DrawingAreaClass o Source #

#### Instances

Instances details

DrawingAreaClass DrawingArea Source # |
Instance details Defined in Graphics.UI.Gtk.Types
DrawingAreaClass Spinner Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToDrawingArea :: GObjectClass obj => obj -> DrawingArea Source #

gTypeDrawingArea :: GType Source #

toDrawingArea :: DrawingAreaClass o => o -> DrawingArea Source #

# Constructors

drawingAreaNew :: IO DrawingArea Source #

Creates a new drawing area.

# Methods