1Gnome2::Canvas::main(3)User Contributed Perl DocumentatioGnnome2::Canvas::main(3)
2
3
4

NAME

6       Gnome2::Canvas::main - A structured graphics canvas
7

METHODS

9   widget = Gnome2::Canvas->new
10       Create a new empty canvas in non-antialiased mode.
11
12   widget = Gnome2::Canvas->new_aa
13       Create a new empty canvas in antialiased mode.
14
15   boolean = $canvas->aa
16       Returns true if $canvas was created in anti-aliased mode.
17
18   ($bx1, $by1, $bx2, $by2) = Gnome2::Canvas->get_butt_points ($x1, $y1, $x2,
19       $y2, $width, $project)
20       ·   $x1 (double)
21
22       ·   $y1 (double)
23
24       ·   $x2 (double)
25
26       ·   $y2 (double)
27
28       ·   $width (double)
29
30       ·   $project (integer)
31
32   (wx, wy) = $canvas->c2w ($cx, $cy)
33       ·   $cx (integer)
34
35       ·   $cy (integer)
36
37   boolean = $canvas->get_center_scroll_region
38   $canvas->set_center_scroll_region ($center_scroll_region)
39       ·   $center_scroll_region (boolean)
40
41   list = $canvas->get_color ($spec)
42       ·   $spec (string)
43
44       Returns an integer indicating the success of the color allocation and a
45       GdkColor.
46
47   unsigned = $canvas->get_color_pixel ($rgba)
48       ·   $rgba (integer)
49
50   rgbdither = $canvas->get_dither
51   $canvas->set_dither ($dither)
52       ·   $dither (Gtk2::Gdk::RgbDither)
53
54   item = $canvas->get_item_at ($x, $y)
55       ·   $x (double)
56
57       ·   $y (double)
58
59   ($mx1, $my1, $mx2, $my2) = Gnome2::Canvas->get_miter_points ($x1, $y1, $x2,
60       $y2, $x3, $y3, $width)
61       ·   $x1 (double)
62
63       ·   $y1 (double)
64
65       ·   $x2 (double)
66
67       ·   $y2 (double)
68
69       ·   $x3 (double)
70
71       ·   $y3 (double)
72
73       ·   $width (double)
74
75   double = $canvas->get_pixels_per_unit
76       Fetch $canvas' scale factor.
77
78   $canvas->set_pixels_per_unit ($n)
79       ·   $n (double)
80
81       Set the zooming factor of $canvas by specifying the number of screen
82       pixels that correspond to one canvas unit.
83
84   double = Gnome2::Canvas->polygon_to_point ($poly_ref, $x, $y)
85       ·   $poly_ref (arrayref) coordinate pairs that make up the polygon
86
87       ·   $x (double)
88
89       ·   $y (double)
90
91       Return the distance from the point $x,$y to the polygon described by
92       the vertices in $poly_ref, or zero if the point is inside the polygon.
93
94   $canvas->request_redraw ($x1, $y1, $x2, $y2)
95       ·   $x1 (integer)
96
97       ·   $y1 (integer)
98
99       ·   $x2 (integer)
100
101       ·   $y2 (integer)
102
103   group = $canvas->root
104   (cx, cy) = $canvas->get_scroll_offsets
105   (x1, y1, x2, y2) = $canvas->get_scroll_region
106   $canvas->set_scroll_region ($x1, $y1, $x2, $y2)
107       ·   $x1 (double)
108
109       ·   $y1 (double)
110
111       ·   $x2 (double)
112
113       ·   $y2 (double)
114
115   $canvas->scroll_to ($cx, $cy)
116       ·   $cx (integer)
117
118       ·   $cy (integer)
119
120   $canvas->set_stipple_origin ($gc)
121       ·   $gc (Gtk2::Gdk::GC)
122
123   $canvas->update_now
124   (cx, cy) = $canvas->w2c ($wx, $wy)
125       ·   $wx (double)
126
127       ·   $wy (double)
128
129   $affine = $canvas->w2c_affine
130       Fetch the affine transform that converts from world coordinates to
131       canvas pixel coordinates.
132
133       Note: This method was completely broken for all
134       $Gnome2::Canvas::VERSION < 1.002.
135
136   (cx, cy) = $canvas->w2c_d ($wx, $wy)
137       ·   $wx (double)
138
139       ·   $wy (double)
140
141   (worldx, worldy) = $canvas->window_to_world ($winx, $winy)
142       ·   $winx (double)
143
144       ·   $winy (double)
145
146   (winx, winy) = $canvas->world_to_window ($worldx, $worldy)
147       ·   $worldx (double)
148
149       ·   $worldy (double)
150

ENUMS AND FLAGS

152   enum Gtk2::Gdk::RgbDither
153       ·   'none' / 'GDK_RGB_DITHER_NONE'
154
155       ·   'normal' / 'GDK_RGB_DITHER_NORMAL'
156
157       ·   'max' / 'GDK_RGB_DITHER_MAX'
158

SEE ALSO

160       Gnome2::Canvas
161
163       Copyright (C) 2003-2004 by the Gtk2-Perl Team.
164
165       This software is licensed under the LGPL; see Gnome2::Canvas for a full
166       notice.
167
168
169
170perl v5.32.0                      2021-01-05           Gnome2::Canvas::main(3)
Impressum