GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GOO::CANVAS (3)

.ds Aq ’

NAME

Goo::Canvas

CONTENTS

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 = CW$canvas->get_bounds

CW$canvas->set_bounds ($left, CW$top, CW$right, CW$bottom)

o $left (double)
o $top (double)
o $right (double)
o $bottom (double)

cairo_surface_t = CW$pixbuf->cairo_surface_from_pixbuf

CW$canvas->convert_from_item_space ($item, CW$x, CW$y)

o $item (Goo::Canvas::Item)
o $x (double)
o $y (double)

CW$canvas->convert_from_pixels ($x, CW$y)

o $x (double)
o $y (double)

CW$canvas->convert_to_item_space ($item, CW$x, CW$y)

o $item (Goo::Canvas::Item)
o $x (double)
o $y (double)

CW$canvas->convert_to_pixels ($x, CW$y)

o $x (double)
o $y (double)

item = CW$canvas->create_item ($model)

o $model (Goo::Canvas::ItemModel)

CW$commands->create_path ($cr)

o $cr (cairo_t)

double = CW$canvas->get_default_line_width

CW$canvas->grab_focus ($item)

o $item (Goo::Canvas::Item)

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

o $x (double)
o $y (double)
o $is_pointer_event (boolean)

item = CW$canvas->get_item ($model)

o $model (Goo::Canvas::ItemModel)

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

o $x (double)
o $y (double)
o $is_pointer_event (boolean)

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

o $area (GooCanvasBounds)
o $inside_area (boolean)
o $allow_overlaps (boolean)
o $include_containers (boolean)

grabstatus = CW$canvas->keyboard_grab ($item, CW$owner_events, CW$time)

o $item (Goo::Canvas::Item)
o $owner_events (boolean)
o $time (unsigned)

CW$canvas->keyboard_ungrab ($item, CW$time)

o $item (Goo::Canvas::Item)
o $time (unsigned)

GArray = CW$path_data->parse_path_data

grabstatus = CW$canvas->pointer_grab ($item, CW$event_mask, CW$cursor, CW$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)

CW$canvas->pointer_ungrab ($item, CW$time)

o $item (Goo::Canvas::Item)
o $time (unsigned)

CW$canvas->register_widget_item ($witem)

o $witem (Goo::Canvas::Widget)

CW$canvas->render ($cr, CW$bounds, CW$scale)

o $cr (cairo_t)
o $bounds (GooCanvasBounds)
o $scale (double)

CW$canvas->request_redraw ($bounds)

o $bounds (GooCanvasBounds)

CW$canvas->request_update

item = CW$canvas->get_root_item

itemmodel = CW$canvas->get_root_item_model

CW$canvas->set_root_item_model ($model)

o $model (Goo::Canvas::ItemModel)

CW$canvas->set_root_item ($item)

o $item (Goo::Canvas::Item)

double = CW$canvas->get_scale

CW$canvas->set_scale ($scale)

o $scale (double)

CW$canvas->scroll_to ($left, CW$top)

o $left (double)
o $top (double)

CW$canvas->unregister_item ($model)

o $model (Goo::Canvas::ItemModel)

CW$canvas->unregister_widget_item ($witem)

o $witem (Goo::Canvas::Widget)

CW$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

<B>set-scroll-adjustmentsB> (Goo::Canvas, Gtk2::Adjustment, Gtk2::Adjustment)
<B>item-createdB> (Goo::Canvas, Goo::Canvas::Item, Goo::Canvas::ItemModel)

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) 2016 Gtk2-Perl Team
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GOO::CANVAS (3) 2016-04-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.