GtkDrawingArea

A widget for creating custom user interface elements.

Object Hierarchy

GObject
`-- GtkObject
       `-- GtkWidget
              `-- GtkDrawingArea

Direct Subclasses

Description

This widget is essentially a blank widget, on which you can draw by accessing its window field, which is a GdkWindow. You may use the widget to paint custom patterns or for interactive programs like scribble.

There are three important signals of GtkWindow that are especially useful for this widget. The realize signal is used to take neccessary actions when the widget is instantiated on a particular display. Use the configure-event signal to define what happens when the widget is changes size, and finally, the expose-event signal will allow you to handle redrawing the contents of the drawing area.

An expose event also occurs when the drawing area first appears on the screen, and also when the widget is covered by another window and subsequently uncovered. You will most probably use GdkWindow's drawing methods to paint the drawing area.

To receive mouse events on a drawing area, you have to enable them by using add_events() .

Avoid using the drawing area unless you really need the flexibility and thereby the complexity that it brings along. You'll be working on the Gdk layer rather than the Gtk layer when using this widget. Most of the time, clever use of the GtkImage widget can prove to be an easier alternative to using a GtkDrawingArea.

Constructors

-- Creates a new GtkDrawingArea widget.

Methods

size()
  DEPRECATED. Sets the size of the drawing area.