1Gtk2::Gdk::GC(3)      User Contributed Perl Documentation     Gtk2::Gdk::GC(3)
2
3
4

NAME

6       Gtk2::Gdk::GC
7

HIERARCHY

9         Glib::Object
10         +----Gtk2::Gdk::GC
11

METHODS

13   gc = Gtk2::Gdk::GC->new ($drawable, $values=undef)
14           ·   $drawable (Gtk2::Gdk::Drawable)
15
16           ·   $values (scalar)
17
18           Create and return a new GC.
19
20           $drawable is used for the depth and the display
21           ("Gtk2::Gdk::Display") for the GC.  The GC can then be used with
22           any drawable of the same depth on that display.
23
24           $values is a hashref containing some of the following keys,
25
26               foreground          Gtk2::Gdk::Color
27               background          Gtk2::Gdk::Color
28               font                Gtk2::Gdk::Font
29               function            Gtk2::Gdk::Function enum
30               fill                Gtk2::Gdk::Fill enum
31               tile                Gtk2::Gdk::Pixmap
32               stipple             Gtk2::Gdk::Pixmap
33               clip_mask           Gtk2::Gdk::Pixmap
34               subwindow_mode      Gtk2::Gdk::SubwindowMode enum
35               ts_x_origin         integer
36               ts_y_origin         integer
37               clip_x_origin       integer
38               clip_y_origin       integer
39               graphics_exposures  boolean integer 1 or 0
40               line_width          integer
41               line_style          Gtk2::Gdk::LineStyle enum
42               cap_style           Gtk2::Gdk::CapStyle enum
43               join_style          Gtk2::Gdk::JoinStyle enum
44
45           Keys not given get default values.  For the "foreground" and
46           "background" colour objects only the "pixel" field is used; the
47           red, green and blue are ignored.  For example
48
49               my $pixel = 0x123456;
50               my $color = Gtk2::Gdk::Color->new (0,0,0, $pixel);
51               my $gc = Gtk2::Gdk::GC->new_with_values
52                 ($win, { foreground => $color,
53                          line_style => 'on_off_dash' });
54
55   gc = Gtk2::Gdk::GC->new_with_values ($drawable, $values=undef)
56           ·   $drawable (Gtk2::Gdk::Drawable)
57
58           ·   $values (scalar)
59
60   $gc->set_background ($color)
61           ·   $color (Gtk2::Gdk::Color)
62
63   $gc->set_clip_mask ($mask)
64           ·   $mask (scalar)
65
66   $gc->set_clip_origin ($x, $y)
67           ·   $x (integer)
68
69           ·   $y (integer)
70
71   $gc->set_clip_rectangle ($rectangle)
72           ·   $rectangle (Gtk2::Gdk::Rectangle or undef)
73
74   $gc->set_clip_region ($region)
75           ·   $region (Gtk2::Gdk::Region or undef)
76
77   colormap = $gc->get_colormap
78   $gc->set_colormap ($colormap)
79           ·   $colormap (Gtk2::Gdk::Colormap)
80
81   $dst_gc->copy ($src_gc)
82           ·   $src_gc (Gtk2::Gdk::GC)
83
84   $gc->set_dashes ($dash_offset, ...)
85           ·   $dash_offset (integer)
86
87           ·   ... (list) of integers, the length of the dash segments
88
89           Sets the way dashed-lines are drawn. Lines will be drawn with
90           alternating on and off segments of the lengths specified in list of
91           dashes. The manner in which the on and off segments are drawn is
92           determined by the line_style value of the GC.
93
94   $gc->set_exposures ($exposures)
95           ·   $exposures (boolean)
96
97   $gc->set_fill ($fill)
98           ·   $fill (Gtk2::Gdk::Fill)
99
100   $gc->set_font ($font)
101           ·   $font (Gtk2::Gdk::Font)
102
103   $gc->set_foreground ($color)
104           ·   $color (Gtk2::Gdk::Color)
105
106   $gc->set_function ($function)
107           ·   $function (Gtk2::Gdk::Function)
108
109   $gc->set_line_attributes ($line_width, $line_style, $cap_style,
110       $join_style)
111           ·   $line_width (integer)
112
113           ·   $line_style (Gtk2::Gdk::LineStyle)
114
115           ·   $cap_style (Gtk2::Gdk::CapStyle)
116
117           ·   $join_style (Gtk2::Gdk::JoinStyle)
118
119   $gc->offset ($x_offset, $y_offset)
120           ·   $x_offset (integer)
121
122           ·   $y_offset (integer)
123
124   $gc->set_rgb_background ($rgb)
125           ·   $rgb (unsigned)
126
127   $gc->set_rgb_bg_color ($color)
128           ·   $color (Gtk2::Gdk::Color)
129
130   $gc->set_rgb_fg_color ($color)
131           ·   $color (Gtk2::Gdk::Color)
132
133   $gc->set_rgb_foreground ($rgb)
134           ·   $rgb (unsigned)
135
136   $gc->rgb_gc_set_background ($rgb)
137           ·   $rgb (unsigned)
138
139   $gc->rgb_gc_set_foreground ($rgb)
140           ·   $rgb (unsigned)
141
142   screen = $gc->get_screen
143           Since: gtk+ 2.2
144
145   $gc->set_stipple ($stipple)
146           ·   $stipple (Gtk2::Gdk::Pixmap)
147
148   $gc->set_subwindow ($mode)
149           ·   $mode (Gtk2::Gdk::SubwindowMode)
150
151   $gc->set_tile ($tile)
152           ·   $tile (Gtk2::Gdk::Pixmap)
153
154   $gc->set_ts_origin ($x, $y)
155           ·   $x (integer)
156
157           ·   $y (integer)
158
159   scalar = $gc->get_values
160           Return the attributes of $gc in the form of a hashref with keys and
161           values as described with "new" above.
162
163           In the "foreground" and "background" colour objects returned only
164           the "pixel" fields are set; the red, green and blue fields are
165           garbage.
166
167   $gc->set_values ($values)
168           ·   $values (scalar)
169
170           Set some of the attributes of $gc.  $values is a hashref of keys
171           and values as described for "new" and "new_with_values" above.
172           Fields not present in $values are left unchanged.
173

ENUMS AND FLAGS

175   enum Gtk2::Gdk::CapStyle
176       ·   'not-last' / 'GDK_CAP_NOT_LAST'
177
178       ·   'butt' / 'GDK_CAP_BUTT'
179
180       ·   'round' / 'GDK_CAP_ROUND'
181
182       ·   'projecting' / 'GDK_CAP_PROJECTING'
183
184   enum Gtk2::Gdk::Fill
185       ·   'solid' / 'GDK_SOLID'
186
187       ·   'tiled' / 'GDK_TILED'
188
189       ·   'stippled' / 'GDK_STIPPLED'
190
191       ·   'opaque-stippled' / 'GDK_OPAQUE_STIPPLED'
192
193   enum Gtk2::Gdk::Function
194       ·   'copy' / 'GDK_COPY'
195
196       ·   'invert' / 'GDK_INVERT'
197
198       ·   'xor' / 'GDK_XOR'
199
200       ·   'clear' / 'GDK_CLEAR'
201
202       ·   'and' / 'GDK_AND'
203
204       ·   'and-reverse' / 'GDK_AND_REVERSE'
205
206       ·   'and-invert' / 'GDK_AND_INVERT'
207
208       ·   'noop' / 'GDK_NOOP'
209
210       ·   'or' / 'GDK_OR'
211
212       ·   'equiv' / 'GDK_EQUIV'
213
214       ·   'or-reverse' / 'GDK_OR_REVERSE'
215
216       ·   'copy-invert' / 'GDK_COPY_INVERT'
217
218       ·   'or-invert' / 'GDK_OR_INVERT'
219
220       ·   'nand' / 'GDK_NAND'
221
222       ·   'nor' / 'GDK_NOR'
223
224       ·   'set' / 'GDK_SET'
225
226   enum Gtk2::Gdk::JoinStyle
227       ·   'miter' / 'GDK_JOIN_MITER'
228
229       ·   'round' / 'GDK_JOIN_ROUND'
230
231       ·   'bevel' / 'GDK_JOIN_BEVEL'
232
233   enum Gtk2::Gdk::LineStyle
234       ·   'solid' / 'GDK_LINE_SOLID'
235
236       ·   'on-off-dash' / 'GDK_LINE_ON_OFF_DASH'
237
238       ·   'double-dash' / 'GDK_LINE_DOUBLE_DASH'
239
240   enum Gtk2::Gdk::SubwindowMode
241       ·   'clip-by-children' / 'GDK_CLIP_BY_CHILDREN'
242
243       ·   'include-inferiors' / 'GDK_INCLUDE_INFERIORS'
244

SEE ALSO

246       Gtk2, Glib::Object
247
249       Copyright (C) 2003-2008 by the gtk2-perl team.
250
251       This software is licensed under the LGPL.  See Gtk2 for a full notice.
252
253
254
255perl v5.12.0                      2010-05-02                  Gtk2::Gdk::GC(3)
Impressum