|
|
| |
Goo::Canvas(3) |
User Contributed Perl Documentation |
Goo::Canvas(3) |
Goo::Canvas - wrapper for GooCanvas
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Goo::Canvas
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
use Goo::Canvas;
use Gtk2 '-init';
use Glib qw(TRUE FALSE);
my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event' => sub { Gtk2->main_quit; });
$window->set_default_size(640, 600);
my $swin = Gtk2::ScrolledWindow->new;
$swin->set_shadow_type('in');
$window->add($swin);
my $canvas = Goo::Canvas->new();
$canvas->set_size_request(600, 450);
$canvas->set_bounds(0, 0, 1000, 1000);
$swin->add($canvas);
my $root = $canvas->get_root_item();
my $rect = Goo::Canvas::Rect->new(
$root, 100, 100, 400, 400,
'line-width' => 10,
'radius-x' => 20,
'radius-y' => 10,
'stroke-color' => 'yellow',
'fill-color' => 'red'
);
$rect->signal_connect('button-press-event',
\&on_rect_button_press);
my $text = Goo::Canvas::Text->new(
$root, "Hello World", 300, 300, -1, 'center',
'font' => 'Sans 24',
);
$text->rotate(45, 300, 300);
$window->show_all();
Gtk2->main;
sub on_rect_button_press {
print "Rect item pressed!\n";
return TRUE;
}
GTK+ doesn't has an built-in canvas widget. GooCanvas is wonderful. It is easy
to use and has powerful and extensible methods to create items in canvas. Just
try it.
For more documents, please read GooCanvas Manual and the demo
programs provided in the source distribution in both perl-Goo::Canvas and
GooCanvas.
- $left (double)
- $top (double)
- $right (double)
- $bottom (double)
- $item (Goo::Canvas::Item)
- $x (double)
- $y (double)
- $item (Goo::Canvas::Item)
- $x (double)
- $y (double)
- •
- $model (Goo::Canvas::ItemModel)
- •
- $item (Goo::Canvas::Item)
- $x (double)
- $y (double)
- $is_pointer_event (boolean)
- •
- $model (Goo::Canvas::ItemModel)
- $x (double)
- $y (double)
- $is_pointer_event (boolean)
- $area (GooCanvasBounds)
- $inside_area (boolean)
- $allow_overlaps (boolean)
- $include_containers (boolean)
- $item (Goo::Canvas::Item)
- $owner_events (boolean)
- $time (unsigned)
- $item (Goo::Canvas::Item)
- $time (unsigned)
- $item (Goo::Canvas::Item)
- $event_mask (Gtk2::Gdk::EventMask)
- $cursor (Gtk2::Gdk::Cursor) the cursor to display
during the grab, or undef means no change
- $time (unsigned)
- $item (Goo::Canvas::Item)
- $time (unsigned)
- •
- $witem (Goo::Canvas::Widget)
- $cr (cairo_t)
- $bounds (GooCanvasBounds)
- $scale (double)
- •
- $bounds (GooCanvasBounds)
- •
- $model (Goo::Canvas::ItemModel)
- •
- $item (Goo::Canvas::Item)
- $left (double)
- $top (double)
- •
- $model (Goo::Canvas::ItemModel)
- •
- $witem (Goo::Canvas::Widget)
- 'anchor' (Gtk2::AnchorType : default "north-west" : readable /
writable)
- Where to place the canvas when it is smaller than the widget's allocated
area
- 'automatic-bounds' (boolean : default false : readable / writable)
- If the bounds are automatically calculated based on the bounds of all the
items in the canvas
- 'background-color' (string : default undef : writable)
- The color to use for the canvas background
- 'background-color-rgb' (Glib::UInt : default 0 : writable)
- The color to use for the canvas background, specified as a 24-bit integer
value, 0xRRGGBB
- 'bounds-from-origin' (boolean : default true : readable / writable)
- If the automatic bounds are calculated from the origin
- 'bounds-padding' (double : default 0 : readable / writable)
- The padding added to the automatic bounds
- 'clear-background' (boolean : default true : readable / writable)
- If the background is cleared before the canvas is painted
- 'integer-layout' (boolean : default false : readable / writable)
- If all item layout is done to the nearest integer
- 'redraw-when-scrolled' (boolean : default false : readable /
writable)
- If the canvas is completely redrawn when scrolled, to reduce the flicker
of static items
- 'resolution-x' (double : default 96 : readable / writable)
- The horizontal resolution of the display, in dots per inch
- 'resolution-y' (double : default 96 : readable / writable)
- The vertical resolution of the display, in dots per inch
- 'scale' (double : default 1 : readable / writable)
- The magnification factor of the canvas
- 'scale-x' (double : default 1 : readable / writable)
- The horizontal magnification factor of the canvas
- 'scale-y' (double : default 1 : readable / writable)
- The vertical magnification factor of the canvas
- 'units' (Gtk2::Unit : default "pixel" : readable /
writable)
- The units to use for the canvas
- 'x1' (double : default 0 : readable / writable)
- The x coordinate of the left edge of the canvas bounds, in canvas
units
- 'x2' (double : default 1000 : readable / writable)
- The x coordinate of the right edge of the canvas bounds, in canvas
units
- 'y1' (double : default 0 : readable / writable)
- The y coordinate of the top edge of the canvas bounds, in canvas
units
- 'y2' (double : default 1000 : readable / writable)
- The y coordinate of the bottom edge of the canvas bounds, in canvas
units
- item-created (Goo::Canvas, Goo::Canvas::Item,
Goo::Canvas::ItemModel)
- set-scroll-adjustments (Goo::Canvas, Gtk2::Adjustment,
Gtk2::Adjustment)
- 'center' / 'GTK_ANCHOR_CENTER'
- 'north' / 'GTK_ANCHOR_NORTH'
- 'north-west' / 'GTK_ANCHOR_NORTH_WEST'
- 'north-east' / 'GTK_ANCHOR_NORTH_EAST'
- 'south' / 'GTK_ANCHOR_SOUTH'
- 'south-west' / 'GTK_ANCHOR_SOUTH_WEST'
- 'south-east' / 'GTK_ANCHOR_SOUTH_EAST'
- 'west' / 'GTK_ANCHOR_WEST'
- 'east' / 'GTK_ANCHOR_EAST'
- 'n' / 'GTK_ANCHOR_N'
- 'nw' / 'GTK_ANCHOR_NW'
- 'ne' / 'GTK_ANCHOR_NE'
- 's' / 'GTK_ANCHOR_S'
- 'sw' / 'GTK_ANCHOR_SW'
- 'se' / 'GTK_ANCHOR_SE'
- 'w' / 'GTK_ANCHOR_W'
- 'e' / 'GTK_ANCHOR_E'
- 'exposure-mask' / 'GDK_EXPOSURE_MASK'
- 'pointer-motion-mask' / 'GDK_POINTER_MOTION_MASK'
- 'pointer-motion-hint-mask' / 'GDK_POINTER_MOTION_HINT_MASK'
- 'button-motion-mask' / 'GDK_BUTTON_MOTION_MASK'
- 'button1-motion-mask' / 'GDK_BUTTON1_MOTION_MASK'
- 'button2-motion-mask' / 'GDK_BUTTON2_MOTION_MASK'
- 'button3-motion-mask' / 'GDK_BUTTON3_MOTION_MASK'
- 'button-press-mask' / 'GDK_BUTTON_PRESS_MASK'
- 'button-release-mask' / 'GDK_BUTTON_RELEASE_MASK'
- 'key-press-mask' / 'GDK_KEY_PRESS_MASK'
- 'key-release-mask' / 'GDK_KEY_RELEASE_MASK'
- 'enter-notify-mask' / 'GDK_ENTER_NOTIFY_MASK'
- 'leave-notify-mask' / 'GDK_LEAVE_NOTIFY_MASK'
- 'focus-change-mask' / 'GDK_FOCUS_CHANGE_MASK'
- 'structure-mask' / 'GDK_STRUCTURE_MASK'
- 'property-change-mask' / 'GDK_PROPERTY_CHANGE_MASK'
- 'visibility-notify-mask' / 'GDK_VISIBILITY_NOTIFY_MASK'
- 'proximity-in-mask' / 'GDK_PROXIMITY_IN_MASK'
- 'proximity-out-mask' / 'GDK_PROXIMITY_OUT_MASK'
- 'substructure-mask' / 'GDK_SUBSTRUCTURE_MASK'
- 'scroll-mask' / 'GDK_SCROLL_MASK'
- 'all-events-mask' / 'GDK_ALL_EVENTS_MASK'
- 'success' / 'GDK_GRAB_SUCCESS'
- 'already-grabbed' / 'GDK_GRAB_ALREADY_GRABBED'
- 'invalid-time' / 'GDK_GRAB_INVALID_TIME'
- 'not-viewable' / 'GDK_GRAB_NOT_VIEWABLE'
- 'frozen' / 'GDK_GRAB_FROZEN'
- 'pixel' / 'GTK_UNIT_PIXEL'
- 'points' / 'GTK_UNIT_POINTS'
- 'inch' / 'GTK_UNIT_INCH'
- 'mm' / 'GTK_UNIT_MM'
Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
Gtk2::Container
Copyright (C) 2022 Gtk2-Perl Team
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc. |