3

I need a simple image widget with a support of panning/zooming but unfortunately it appears GTK still does not offer one. I have managed to achieve something similar by using a ScrolledWindow and a Picture backed by a PixBuf (via scaling the PixBuf on demand and a EventControllerMotion to mimic panning), but needless to say that this approach is too slow for smooth zooming on touchpads and uses an insanely high amount of memory due to no tiling.

A suggested approach seems to be using GEGL, but it's not obvious how one is supposed to do that. There seems to be helper libraries for previous versions of GTK (gegl-gtk and gegl-gtk3) but I do not know how one is supposed to use it with GTK 4 applications. And to be honest the documentations are pretty much non-existent.

So I would appreciate some examples/explanations on basics usages of GEGL within GTK (4) applications, or whether if there is a better way.

zareami10
  • 111
  • 7
  • "It appears GTK still does not offer one" GTK does not give you all possible widgets, instead you need to write it yourself. – Michi Sep 24 '21 at 20:16
  • @Michi Of course, but the very same widget was on the GTK roadmap some years ago, thus that phrasing. And regardless it is such a common use case that one would expect something like that to exist, at least unofficially. – zareami10 Sep 24 '21 at 20:51
  • Ask the [GTK Guys](https://discourse.gnome.org/tags/c/platform/core/9/gtk). – Michi Sep 24 '21 at 20:54

0 Answers0