return to index

VDKCanvas class <canvas.h>

Inherits from VDKObject

Description

This class provides a canvas widget.

Properties

EnableClear , boolean, default is true.
It clears and refresh the screen during the configure event. User can disable it to control the draw during the configure event.

EnableDrag boolean, default is true.
It enables DragStart/Dragging/DragStop events. The user can disable it, then EventMotion occures.
(It is very usefull if the user is not persuated with the implemented drag handling...)

Captured boolean, default is false.
if it is true, the canvas will receive EventMotion/Drag... events if the cursor is outside of the area.

Methods

Tip:
Drawing operations on canvas are not done directly on the screen but using an offscreen backing pixmap. When necessary relevant portions of (or all) backing image is copied to screen. This tecnique makes drawing operations an order of magnitude faster and avoids screen flickering. So all drawing should be followed by Draw() or Redraw() to effectively see the wanted effect. When applicable the best way is to establish an expose_event response function and make drawing there followed by a Redraw() call. See canvaswin.cc on testvdk dir for more detailed informations.

Signals

None

Events

configure_event

expose_event

button_press_event

motion_notify_event

drag_start_event
Generated when user begin to drag mouse

drag_stop_event
Generated when user ends to drag mouse

dragging_event
During user drag operations
Tip: drag_start and drag_stop use a GdkEventButton* structure, dragging_event a GdkEventMotion*.
By default canvas uses owner background and foreground, these can be set using properties. (see canvaswin.cc on ./testvdk dir for more informations)
EXAMPLES: ./testvdk/canvaswin.cc