Gnome2::Canvas::main(3)

NAME
Gnome2::Canvas::main - A structured graphics canvas

METHODS

  widget = Gnome2::Canvas->new
Create a new empty canvas in non-antialiased mode.

  widget = Gnome2::Canvas->new_aa
Create a new empty canvas in antialiased mode.

  boolean = $canvas->aa
Returns true if $canvas was created in anti-aliased mode.

  ($bx1, $by1, $bx2, $by2) = Gnome2::Canvas->get_butt_points ($x1, $y1, $x2, $y2, $width, $project)

•   $x1 (double)

•   $y1 (double)

•   $x2 (double)

•   $y2 (double)

•   $width (double)

•   $project (integer)

  (wx, wy) = $canvas->c2w ($cx, $cy)

•   $cx (integer)

•   $cy (integer)

  boolean = $canvas->get_center_scroll_region

  $canvas->set_center_scroll_region ($center_scroll_region)

•   $center_scroll_region (boolean)

  list = $canvas->get_color ($spec)

•   $spec (string)

Returns an integer indicating the success of the color allocation and a GdkColor.

  unsigned = $canvas->get_color_pixel ($rgba)

•   $rgba (integer)

  rgbdither = $canvas->get_dither

  $canvas->set_dither ($dither)

•   $dither (Gtk2::Gdk::RgbDither)

  item = $canvas->get_item_at ($x, $y)

•   $x (double)

•   $y (double)

  ($mx1, $my1, $mx2, $my2) = Gnome2::Canvas->get_miter_points ($x1, $y1, $x2, $y2, $x3, $y3, $width)

•   $x1 (double)

•   $y1 (double)

•   $x2 (double)

•   $y2 (double)

•   $x3 (double)

•   $y3 (double)

•   $width (double)

  double = $canvas->get_pixels_per_unit
Fetch $canvas' scale factor.

  $canvas->set_pixels_per_unit ($n)

•   $n (double)

Set the zooming factor of $canvas by specifying the number of screen pixels that correspond to one canvas unit.

  double = Gnome2::Canvas->polygon_to_point ($poly_ref, $x, $y)

•   $poly_ref (arrayref) coordinate pairs that make up the polygon

•   $x (double)

•   $y (double)

Return the distance from the point $x,$y to the polygon described by the vertices in $poly_ref, or zero if the point is inside the polygon.

  $canvas->request_redraw ($x1, $y1, $x2, $y2)

•   $x1 (integer)

•   $y1 (integer)

•   $x2 (integer)

•   $y2 (integer)

  group = $canvas->root

  (cx, cy) = $canvas->get_scroll_offsets

  (x1, y1, x2, y2) = $canvas->get_scroll_region

  $canvas->set_scroll_region ($x1, $y1, $x2, $y2)

•   $x1 (double)

•   $y1 (double)

•   $x2 (double)

•   $y2 (double)

  $canvas->scroll_to ($cx, $cy)

•   $cx (integer)

•   $cy (integer)

  $canvas->set_stipple_origin ($gc)

•   $gc (Gtk2::Gdk::GC)

  $canvas->update_now

  (cx, cy) = $canvas->w2c ($wx, $wy)

•   $wx (double)

•   $wy (double)

  $affine = $canvas->w2c_affine
Fetch the affine transform that converts from world coordinates to canvas pixel coordinates.

Note: This method was completely broken for all $Gnome2::Canvas::VERSION < 1.002.

  (cx, cy) = $canvas->w2c_d ($wx, $wy)

•   $wx (double)

•   $wy (double)

  (worldx, worldy) = $canvas->window_to_world ($winx, $winy)

•   $winx (double)

•   $winy (double)

  (winx, winy) = $canvas->world_to_window ($worldx, $worldy)

•   $worldx (double)

•   $worldy (double)

ENUMS AND FLAGS

  enum Gtk2::Gdk::RgbDither

•   'none' / 'GDK_RGB_DITHER_NONE'

•   'normal' / 'GDK_RGB_DITHER_NORMAL'

•   'max' / 'GDK_RGB_DITHER_MAX'

SEE ALSO
Gnome2::Canvas

COPYRIGHT
Copyright (C) 2003-2004 by the Gtk2-Perl Team.

This software is licensed under the LGPL; see Gnome2::Canvas for a full notice.