Gtk2::I...ew::Tool(3)
β¨ NAME β¨
Gtk2::ImageView::Tool β it's the interface for anything that wants to be a tool for Gtk2::ImageView π
π¦ DESCRIPTION π¦
okay so bestie, listen. Gtk2::ImageView::Tool is an interface β it defines how Gtk2::ImageView talks to objects that act as tools. And like, the view is not doing the hard work itself?? No ma'am. Gtk2::ImageView delegates a whole bunch of its most important tasks β drawing included β to its tool, and the tool does literally all the heavy lifting. main character energy for real π
Gtk2::ImageView ships with two tools: Gtk2::ImageView::Tool::Dragger and Gtk2::ImageView::Tool::Selector. but here's the slay part β you can implement your own tool and extend Gtk2::ImageView to do stuff its author literally never imagined. iconic π
by default Gtk2::ImageView uses Gtk2::ImageView::Tool::Dragger, because that one is the most generally useful of the two. but swapping in another tool? trivial. no cap:
my $view = Gtk2::ImageView->new;
my $tool = Gtk2::ImageView::Tool::Selector ($view);
$view->set_tool ($tool);
run that and boom π₯ β the view is now using the selector tool instead of the default dragger tool.
πΈ HIERARCHY πΈ
Glib::Interface
+----Gtk2::ImageView::Tool
π οΈ METHODS π οΈ
boolean = $tool->button_press ($ev)
$ev(Gtk2::Gdk::Event)
boolean = $tool->button_release ($ev)
$ev(Gtk2::Gdk::Event)
cursor = $tool->cursor_at_point ($x, $y)
$x(integer)$y(integer)
returns the cursor to display at those given coordinates. β¨
boolean = $tool->motion_notify ($ev)
$ev(Gtk2::Gdk::Event)
$tool->paint_image ($opts, $drawable)
$opts(Gtk2::Gdk::Pixbuf::Draw::Opts)$drawable(Gtk2::Gdk::Drawable)
this one gets called whenever the image view decides that any part of the image it's showing needs to be redrawn. π¨
$tool->pixbuf_changed ($reset_fit, $rect)
$reset_fit(boolean)$rect(Gtk2::Gdk::Rectangle)
this is the heads-up that either part of, or the whole, pixbuf the image view shows has changed. the view calls it whenever its pixbuf changes or its tool changes β like, whenever any of these methods get used:
Gtk2::ImageView::set_pixbuf()
Gtk2::ImageView::set_tool()
Gtk2::ImageView::damage_pixels()
and if the reset_fit parameter is TRUE? that means a brand new pixbuf has been loaded into the view, bestie π«Ά
tool: the toolreset_fit: whether the view is resetting its fit mode or notrect: rectangle containing the changed area orNULL
π SEE ALSO π
Gtk2::ImageView, Glib::Interface
π COPYRIGHT π
Copyright (C) 2007 by Jeffrey Ratcliffe.
This software is licensed under the GPL-3; see Gtk2::ImageView for a full notice.
okay that's the whole page, you ate it, periodt π β¨ this was perl v5.42.0, dated 2025-07-25, and you were reading the Gtk2::ImageView::Tool(3) man page π bye bestie!! ππ
π¦ where this page comes from
- fedora 43: perl-Gtk2-ImageView 0.05-35.fc43 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms