.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "GooCanvas2 3pm" .TH GooCanvas2 3pm "2020-12-31" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" GooCanvas2 \- Perl binding for GooCanvas2 widget using Glib::Object::Introspection .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& #!/usr/bin/perl \-w \& use strict; \& use warnings; \& \& use Gtk3 \-init; \& use GooCanvas2; \& \& my $window = Gtk3::Window\->new(); \& $window\->set_default_size(640, 600); \& $window\->signal_connect(\*(Aqdestroy\*(Aq => sub {Gtk3\->main_quit()}); \& \& my $scrolled_win = Gtk3::ScrolledWindow\->new(); \& $scrolled_win\->set_shadow_type(\*(Aqin\*(Aq); \& \& my $canvas = GooCanvas2::Canvas\->new(); \& $canvas\->set_size_request(600,450); \& $canvas\->set_bounds(0,0,1000,1000); \& $scrolled_win\->add($canvas); \& \& my $root = $canvas\->get_root_item(); \& \& # Add a few simple items \& my $rect_item = GooCanvas2::CanvasRect\->new(\*(Aqparent\*(Aq => $root, \& \*(Aqx\*(Aq => 100, \& \*(Aqy\*(Aq => 100, \& \*(Aqwidth\*(Aq => 300, \& \*(Aqheight\*(Aq => 300, \& \*(Aqline_width\*(Aq => 10.0, \& \*(Aqradius\-x\*(Aq => 20.0, \& \*(Aqradius\-y\*(Aq => 10.0, \& \*(Aqstroke\-color\*(Aq => \*(Aqyellow\*(Aq, \& \*(Aqfill\-color\*(Aq => \*(Aqred\*(Aq); \& \& my $text_item = GooCanvas2::CanvasText\->new(\*(Aqparent\*(Aq => $root, \& \*(Aqtext\*(Aq => \*(AqHello World\*(Aq, \& \*(Aqx\*(Aq => 300, \*(Aqy\*(Aq => 300, \& \*(Aqwidth\*(Aq => \-1, \& \*(Aqanchor\*(Aq => \*(Aqcenter\*(Aq, \& \*(Aqfont\*(Aq => \*(AqSans 24\*(Aq); \& $text_item\->rotate(45, 300, 300); \& \& # Connect a signal handler for the rectangle item. \& $rect_item\->signal_connect(\*(Aqbutton_press_event\*(Aq => \e&on_rect_button_press); \& \& $window\->add($scrolled_win); \& $window\->show_all; \& \& # Pass control to the Gtk3 main event loop \& Gtk3\->main(); \& \& # This handles button presses in item views. \& #We simply output a message to the console \& sub on_rect_button_press { \& my ($item, $target, $event) = @_; \& print "rect item received button press event \en"; \& return 1; \& } .Ve .SH "INSTALLATION" .IX Header "INSTALLATION" You need to install the typelib file for GooCanvas\-2.0. For example on Debian/Ubuntu it should be necessary to install the following package: .PP .Vb 1 \& sudo apt\-get install gir1.2\-goocanvas\-2.0 .Ve .PP On Mageia for example you have to install: .PP .Vb 1 \& urpmi lib64goocanvas\-gir2.0 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" GooCanvas2 is a new canvas widget for use with Gtk3 that uses the Cairo 2d library for drawing. This is a simple and basic implementation of this wonderful Canvas widget. .PP For more information see .PP For instructions, how to use GooCanvas2, please study the \s-1API\s0 reference at for now. A perl-specific documentation will perhaps come in later versions. But applying the C documentation should be no problem. .SS "\s-1OBJECTS, ITEMS, MODELS\s0" .IX Subsection "OBJECTS, ITEMS, MODELS" The GooCanvas2 module provides the following objects, items and models. For more details see . .PP \fICore Objects\fR .IX Subsection "Core Objects" .IP "\(bu" 4 GooCanvas2::Canvas \- the main canvas widget .IP "\(bu" 4 GooCanvas2::CanvasItem \- the interface for canvas items .IP "\(bu" 4 GooCanvas2::CanvasItemModel \- the interface for canvas item models. .IP "\(bu" 4 GooCanvas2::CanvasItemSimple \- the base class for the standard canvas items. .IP "\(bu" 4 GooCanvas2::CanvasItemModelSimple \- the base class for the standard canvas item models. .IP "\(bu" 4 GooCanvas2::CanvasStyle \- support for cascading style properties for canvas items. .PP \fIStandard Canvas Items\fR .IX Subsection "Standard Canvas Items" .IP "\(bu" 4 GooCanvas2::CanvasGroup \- a group of items. .IP "\(bu" 4 GooCanvas2::CanvasEllipse \- an ellipse item. .IP "\(bu" 4 GooCanvas2::CanvasGrid \- a grid item. .IP "\(bu" 4 GooCanvas2::CanvasImage \- an image item. .IP "\(bu" 4 GooCanvas2::CanvasPath \- a path item (a series of lines and curves). .IP "\(bu" 4 GooCanvas2::CanvasPolyline \- a polyline item (a series of lines with optional arrows). .IP "\(bu" 4 GooCanvas2::CanvasRect \- a rectangle item. .IP "\(bu" 4 GooCanvas2::CanvasText \- a text item. .IP "\(bu" 4 GooCanvas2::CanvasWidget \- an embedded widget item. .IP "\(bu" 4 GooCanvas2::CanvasTable \- a table container to layout items. .PP \fIStandard Canvas Item Models\fR .IX Subsection "Standard Canvas Item Models" .IP "\(bu" 4 GooCanvas2::CanvasGroupModel \- a model for a group of items. .IP "\(bu" 4 GooCanvas2::CanvasEllipseModel \- a model for ellipse items. .IP "\(bu" 4 GooCanvas2::CanvasGridModel \- a model for grid items. .IP "\(bu" 4 GooCanvas2::CanvasImageModel \- a model for image items. .IP "\(bu" 4 GooCanvas2::CanvasPathModel \- a model for path items (a series of lines and curves). .IP "\(bu" 4 GooCanvas2::CanvasPolylineModel \- a model for polyline items (a series of lines with optional arrows). .IP "\(bu" 4 GooCanvas2::CanvasRectModel \- a model for rectangle items. .IP "\(bu" 4 GooCanvas2::CanvasTextModel \- a model for text items. .IP "\(bu" 4 GooCanvas2::CanvasTableModel \- a model for a table container to layout items. .SS "Development status and informations" .IX Subsection "Development status and informations" \fICustomizations and overrides\fR .IX Subsection "Customizations and overrides" .PP In order to make things more Perlish, GooCanvas2 customizes the \s-1API\s0 generated by Glib::Object::Introspection in a few spots: .IP "\(bu" 4 The array ref normally returned by the following functions is flattened into a list: .RS 4 .IP "GooCanvas2::Canvas::get_items_at" 4 .IX Item "GooCanvas2::Canvas::get_items_at" .PD 0 .IP "GooCanvas2::Canvas::get_items_in_area" 4 .IX Item "GooCanvas2::Canvas::get_items_in_area" .IP "GooCanvas2::CanvasItem::get_items_at" 4 .IX Item "GooCanvas2::CanvasItem::get_items_at" .IP "GooCanvas2::CanvasItem::class_list_child_properties" 4 .IX Item "GooCanvas2::CanvasItem::class_list_child_properties" .IP "GooCanvas2::CanvasItemModell::class_list_child_properties" 4 .IX Item "GooCanvas2::CanvasItemModell::class_list_child_properties" .RE .RS 4 .RE .PD .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 GooCanvas Homepage at .IP "\(bu" 4 GooCanvas2 \s-1API\s0 Reference .IP "\(bu" 4 Gtk3 .IP "\(bu" 4 Glib::Object::Introspection .SH "AUTHOR" .IX Header "AUTHOR" Maximilian Lika, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2017 by Maximilian Lika .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.3 or, at your option, any later version of Perl 5 you may have available.