Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

Standard Canvas Item Reference

This section describes each of the canvas items that come with Gnome, giving a table of arguments and describing any non-obvious arguments.

Rectangle and Ellipse Items

The GnomeCanvasRect and GnomeCanvasEllipse canvas items share exactly the same interface, via a GnomeCanvasRE base class. Their shape is given as a bounding box: a top left coordinate (x1, y1) and a bottom right coordinate (x2, y2). The rectangle item matches the shape of the bounding box; the ellipse is inscribed in the bounding box, touching the center of each side. Rectangles and ellipses can be filled or simply an outline. If they are only an outline, they are considered to be "hollow"; that is, the transparent area inside the shape is not part of the canvas item and events that occur in that area will not be relayed to the item.

GnomeCanvasRE does not behave gracefully if you give the coordinates in the wrong order. That is, x2 must be greater than x1, and y2 must be greater than y1; otherwise GnomeCanvasRE gets confused.

Table 1. GnomeCanvasRE Arguments

Name Type Read/Write Description
x1 double Both Leftmost coordinate
y1 double Both Topmost coordinate
x2 double Both Rightmost coordinate
y2 double Both Bottommost coordinate
fill_color gchar* Write-only Fill color; string for gdk_color_parse(), or NULL for transparent
fill_color_gdk GdkColor* Both Fill color; specified as already-allocated GdkColor
fill_color_rgba guint32 Both Fill color; specified as 32-bit value packing red, green, blue, and alpha into bytes 1, 2, 3, and 4; alpha of 255 is opaque, 0 is invisible
outline_color gchar* Write-only Outline color; string for gdk_color_parse, or NULL for transparent
outline_color_gdk GdkColor* Both Outline color; specified as already-allocated GdkColor
outline_color_rgba guint32 Both Outline color; specified as 32-bit value packing red, green, blue, and alpha into bytes 1, 2, 3, and 4; alpha of 255 is opaque, 0 is invisible
fill_stipple GdkBitmap* Both Stipple to use when drawing fill; GDK mode only
outline_stipple GdkBitmap* Both Stipple to use when drawing outline; GDK mode only
width_pixels guint Write-only Width of the outline, in pixels (independent of zoom)
width_units double Write-only Width of the outline, in canvas units; pixel width changes with zoom factor (pixels per unit)
Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire