11.12Class GdkGC

Objects to encapsulate drawing properties

Class GdkGC( drawable )
drawable a GdkDrawable. The created GC must always be used with drawables of the same depth as this one.

All drawing operations in GDK take a graphics context (GC) argument. A graph ics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics contexts, the number of arguments to each drawing call is greatly reduced, and communication overhead is minimized, since identical arguments do not need to be passed repeatedly.

Most values of a graphics context can be set at creation time by using gdk_gc_new_with_values(), or can be set one-by-one using functions such as gdk_gc_set_foreground(). A few of the values in the GC, such as the dash pattern, can only be set by the latter method.

Methods
get_screenGets the GdkScreen for which gc was created
get_valuesRetrieves the current values from a graphics context.
new_with_valuesCreate a new GC with the given initial values.
set_valuesSets attributes of a graphics context in bulk.

Methods

get_screen

Gets the GdkScreen for which gc was created

GdkGC.get_screen()
Returnthe GdkScreen for gc.

get_values

Retrieves the current values from a graphics context.

GdkGC.get_values()
Returnthe GdkGCValues structure in which to store the results.

Note that only the pixel values of the values->foreground and values->background are filled, use gdk_colormap_query_color() to obtain the rgb values if you need them.

new_with_values

Create a new GC with the given initial values.

GdkGC.new_with_values( drawable, values, values_mask )
drawable a GdkDrawable. The created GC must always be used with drawables of the same depth as this one.
values a structure containing initial values for the GC (GdkGCValues).
values_mask a bit mask indicating which fields in values are set (GdkGCValuesMask).
Returnthe new graphics context.

set_values

Sets attributes of a graphics context in bulk.

GdkGC.set_values( values, values_mask )
values struct containing the new values (GdkGCValues).
values_mask mask indicating which struct fields are to be used (GdkGCValuesMask).

For each flag set in values_mask, the corresponding field will be read from values and set as the new value for gc. If you're only setting a few values on gc, calling individual "setter" functions is likely more convenient.

Made with http://www.falconpl.org