Gtk.GestureZoom

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController Gtk.Gesture Gtk.Gesture Gtk.EventController->Gtk.Gesture Gtk.GestureZoom Gtk.GestureZoom Gtk.Gesture->Gtk.GestureZoom

Subclasses:

None

Methods

Inherited:

Gtk.Gesture (19), Gtk.EventController (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (widget)

get_scale_delta ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.Gesture (2), Gtk.EventController (2)

Signals

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Name

Short Description

scale-changed

This signal is emitted whenever the distance between both tracked sequences changes.

Fields

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Class Details

class Gtk.GestureZoom(**kwargs)
Bases:

Gtk.Gesture

Abstract:

No

Structure:

Gtk.GestureZoomClass

Gtk.GestureZoom is a Gtk.Gesture implementation able to recognize pinch/zoom gestures, whenever the distance between both tracked sequences changes, the Gtk.GestureZoom ::scale-changed signal is emitted to report the scale factor.

classmethod new(widget)[source]
Parameters:

widget (Gtk.Widget) – a Gtk.Widget

Returns:

a newly created Gtk.GestureZoom

Return type:

Gtk.Gesture

Returns a newly created Gtk.Gesture that recognizes zoom in/out gestures (usually known as pinch/zoom).

New in version 3.14.

get_scale_delta()[source]
Returns:

the scale delta

Return type:

float

If self is active, this function returns the zooming difference since the gesture was recognized (hence the starting point is considered 1:1). If self is not active, 1 is returned.

New in version 3.14.

Signal Details

Gtk.GestureZoom.signals.scale_changed(gesture_zoom, scale)
Signal Name:

scale-changed

Flags:

RUN_FIRST

Parameters:
  • gesture_zoom (Gtk.GestureZoom) – The object which received the signal

  • scale (float) – Scale delta, taking the initial state as 1:1

This signal is emitted whenever the distance between both tracked sequences changes.

New in version 3.14.