Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Goo::Canvas(3)	      User Contributed Perl Documentation	Goo::Canvas(3)

NAME
       Goo::Canvas - wrapper for GooCanvas

HIERARCHY
	 Glib::Object
	 +----Glib::InitiallyUnowned
	      +----Gtk2::Object
		   +----Gtk2::Widget
			+----Gtk2::Container
			     +----Goo::Canvas

INTERFACES
	 Glib::Object::_Unregistered::AtkImplementorIface
	 Gtk2::Buildable

SYNOPSIS
	   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;
	   }

DESCRIPTION
       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.

METHODS
   widget = Goo::Canvas->new
   list	= $canvas->get_bounds
   $canvas->set_bounds ($left, $top, $right, $bottom)
       o   $left (double)

       o   $top	(double)

       o   $right (double)

       o   $bottom (double)

   cairo_surface_t = $pixbuf->cairo_surface_from_pixbuf
   $canvas->convert_from_item_space ($item, $x,	$y)
       o   $item (Goo::Canvas::Item)

       o   $x (double)

       o   $y (double)

   $canvas->convert_from_pixels	($x, $y)
       o   $x (double)

       o   $y (double)

   $canvas->convert_to_item_space ($item, $x, $y)
       o   $item (Goo::Canvas::Item)

       o   $x (double)

       o   $y (double)

   $canvas->convert_to_pixels ($x, $y)
       o   $x (double)

       o   $y (double)

   item	= $canvas->create_item ($model)
       o   $model (Goo::Canvas::ItemModel)

   $commands->create_path ($cr)
       o   $cr (cairo_t)

   double = $canvas->get_default_line_width
   $canvas->grab_focus ($item)
       o   $item (Goo::Canvas::Item)

   item	= $canvas->get_item_at ($x, $y,	$is_pointer_event)
       o   $x (double)

       o   $y (double)

       o   $is_pointer_event (boolean)

   item	= $canvas->get_item ($model)
       o   $model (Goo::Canvas::ItemModel)

   arrayref = $canvas->get_items_at ($x, $y, $is_pointer_event)
       o   $x (double)

       o   $y (double)

       o   $is_pointer_event (boolean)

   arrayref = $canvas->get_items_in_area ($area, $inside_area,
       $allow_overlaps,	$include_containers)
       o   $area (GooCanvasBounds)

       o   $inside_area	(boolean)

       o   $allow_overlaps (boolean)

       o   $include_containers (boolean)

   grabstatus =	$canvas->keyboard_grab ($item, $owner_events, $time)
       o   $item (Goo::Canvas::Item)

       o   $owner_events (boolean)

       o   $time (unsigned)

   $canvas->keyboard_ungrab ($item, $time)
       o   $item (Goo::Canvas::Item)

       o   $time (unsigned)

   GArray = $path_data->parse_path_data
   grabstatus =	$canvas->pointer_grab ($item, $event_mask, $cursor, $time)
       o   $item (Goo::Canvas::Item)

       o   $event_mask (Gtk2::Gdk::EventMask)

       o   $cursor (Gtk2::Gdk::Cursor) the cursor to display during the	grab,
	   or undef means no change

       o   $time (unsigned)

   $canvas->pointer_ungrab ($item, $time)
       o   $item (Goo::Canvas::Item)

       o   $time (unsigned)

   $canvas->register_widget_item ($witem)
       o   $witem (Goo::Canvas::Widget)

   $canvas->render ($cr, $bounds, $scale)
       o   $cr (cairo_t)

       o   $bounds (GooCanvasBounds)

       o   $scale (double)

   $canvas->request_redraw ($bounds)
       o   $bounds (GooCanvasBounds)

   $canvas->request_update
   item	= $canvas->get_root_item
   itemmodel = $canvas->get_root_item_model
   $canvas->set_root_item_model	($model)
       o   $model (Goo::Canvas::ItemModel)

   $canvas->set_root_item ($item)
       o   $item (Goo::Canvas::Item)

   double = $canvas->get_scale
   $canvas->set_scale ($scale)
       o   $scale (double)

   $canvas->scroll_to ($left, $top)
       o   $left (double)

       o   $top	(double)

   $canvas->unregister_item ($model)
       o   $model (Goo::Canvas::ItemModel)

   $canvas->unregister_widget_item ($witem)
       o   $witem (Goo::Canvas::Widget)

   $canvas->update
PROPERTIES
       '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

SIGNALS
       item-created (Goo::Canvas, Goo::Canvas::Item, Goo::Canvas::ItemModel)
       set-scroll-adjustments (Goo::Canvas, Gtk2::Adjustment,
       Gtk2::Adjustment)

ENUMS AND FLAGS
   enum	Gtk2::AnchorType
       o   'center' / 'GTK_ANCHOR_CENTER'

       o   'north' / 'GTK_ANCHOR_NORTH'

       o   'north-west'	/ 'GTK_ANCHOR_NORTH_WEST'

       o   'north-east'	/ 'GTK_ANCHOR_NORTH_EAST'

       o   'south' / 'GTK_ANCHOR_SOUTH'

       o   'south-west'	/ 'GTK_ANCHOR_SOUTH_WEST'

       o   'south-east'	/ 'GTK_ANCHOR_SOUTH_EAST'

       o   'west' / 'GTK_ANCHOR_WEST'

       o   'east' / 'GTK_ANCHOR_EAST'

       o   'n' / 'GTK_ANCHOR_N'

       o   'nw'	/ 'GTK_ANCHOR_NW'

       o   'ne'	/ 'GTK_ANCHOR_NE'

       o   's' / 'GTK_ANCHOR_S'

       o   'sw'	/ 'GTK_ANCHOR_SW'

       o   'se'	/ 'GTK_ANCHOR_SE'

       o   'w' / 'GTK_ANCHOR_W'

       o   'e' / 'GTK_ANCHOR_E'

   flags Gtk2::Gdk::EventMask
       o   'exposure-mask' / 'GDK_EXPOSURE_MASK'

       o   'pointer-motion-mask' / 'GDK_POINTER_MOTION_MASK'

       o   'pointer-motion-hint-mask' /	'GDK_POINTER_MOTION_HINT_MASK'

       o   'button-motion-mask'	/ 'GDK_BUTTON_MOTION_MASK'

       o   'button1-motion-mask' / 'GDK_BUTTON1_MOTION_MASK'

       o   'button2-motion-mask' / 'GDK_BUTTON2_MOTION_MASK'

       o   'button3-motion-mask' / 'GDK_BUTTON3_MOTION_MASK'

       o   'button-press-mask' / 'GDK_BUTTON_PRESS_MASK'

       o   'button-release-mask' / 'GDK_BUTTON_RELEASE_MASK'

       o   'key-press-mask' / 'GDK_KEY_PRESS_MASK'

       o   'key-release-mask' /	'GDK_KEY_RELEASE_MASK'

       o   'enter-notify-mask' / 'GDK_ENTER_NOTIFY_MASK'

       o   'leave-notify-mask' / 'GDK_LEAVE_NOTIFY_MASK'

       o   'focus-change-mask' / 'GDK_FOCUS_CHANGE_MASK'

       o   'structure-mask' / 'GDK_STRUCTURE_MASK'

       o   'property-change-mask' / 'GDK_PROPERTY_CHANGE_MASK'

       o   'visibility-notify-mask' / 'GDK_VISIBILITY_NOTIFY_MASK'

       o   'proximity-in-mask' / 'GDK_PROXIMITY_IN_MASK'

       o   'proximity-out-mask'	/ 'GDK_PROXIMITY_OUT_MASK'

       o   'substructure-mask' / 'GDK_SUBSTRUCTURE_MASK'

       o   'scroll-mask' / 'GDK_SCROLL_MASK'

       o   'all-events-mask' / 'GDK_ALL_EVENTS_MASK'

   enum	Gtk2::Gdk::GrabStatus
       o   'success' / 'GDK_GRAB_SUCCESS'

       o   'already-grabbed' / 'GDK_GRAB_ALREADY_GRABBED'

       o   'invalid-time' / 'GDK_GRAB_INVALID_TIME'

       o   'not-viewable' / 'GDK_GRAB_NOT_VIEWABLE'

       o   'frozen' / 'GDK_GRAB_FROZEN'

   enum	Gtk2::Unit
       o   'pixel' / 'GTK_UNIT_PIXEL'

       o   'points' / 'GTK_UNIT_POINTS'

       o   'inch' / 'GTK_UNIT_INCH'

       o   'mm'	/ 'GTK_UNIT_MM'

SEE ALSO
       Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
       Gtk2::Container

COPYRIGHT
       Copyright (C) 2020 Gtk2-Perl Team

perl v5.32.0			  2020-08-30			Goo::Canvas(3)

NAME | HIERARCHY | INTERFACES | SYNOPSIS | DESCRIPTION | METHODS | PROPERTIES | SIGNALS | ENUMS AND FLAGS | SEE ALSO | COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Goo::Canvas&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help