I guess you want to achieve something like this:
Whereas x
and y
describes the point located at the upper left corner of the image section and width
and height
are related to the size of the image section. Further i assume that the GtkImage
object is added to a GtkViewport
widget and the GtkViewport
is added to a GtkScrolledWindow
.
Unfortunately i can't give you a python specific answer since i don't know anything about it. But if you are able to transfer information from gtk's reference manual to python you should be able to implement it.
If you want information about the coordinates of the image section you first have to get the vadjustment
and hadjustment
properties of the GtkScrolledWindow
widget. These properties are GtkAdjustment
objects and contains the information you need. The page-size
property of those objects is related to the size of the visible image section i.e width
and height
. Whereas the value
property of both vadjustment
and hadjustment
defines the point at the upper left corner of the image section i.e. x
and y
.
If you want to react upon changes of the mentioned properties asynchronously you should connect the changed
and value-changed
signals of both adjustment objects to one and the same signal handler.