[pygtk] Viewport set-scroll-adjustments signal
John Finlay
finlay at moeraki.com
Wed Mar 29 04:01:20 WST 2006
Scott Horowitz wrote:
>> Perhaps you can use that code as a base for your own widget, it'll be
>> a lot easier to develop since it's all python.
>>
>> Johan
>>
>
> Thanks Johan. I will look into this as a backup but I would greatly
> prefer not to have to rewrite my own app with different widgets. I'm
> pretty new to pygtk so it would take me a while :)
>
> I would just like to understand why what I'm expecting does not occur.
> Here is a simple demonstration.
>
> http://www.theskyiscrape.com/scott/test.py
>
> If you run this as 'test.py /path/to/some/image.jpg", it displays the
> image inside a viewport with scrollbars (from a ScrolledWindow). When
> you click the scrollbars to pan the image, "test" should get printed
> out via the set-scroll-adjustments signal. As you can see, it doesn't.
>
> According to the documentation, "The "set-scroll-adjustments" signal
> is emitted when one or both of the horizontal and vertical
> gtk.Adjustment objects is changed." Surely I am either using this
> signal incorrectly or have misinterpreted when this signal should
> tripper. Or the signal does not do as advertised.
>
>
The wording of the docs is a bit confusing. The "set-scroll-adjustments"
signal is emitted when one or both Adjustments of the Viewport are set
or replaced for example by using the Viewport.set_hadjustment() method.
To track the change of the Scrollbars you need to connect to the
"value-changed" signal of the appropriate Adjustment.
John
More information about the pygtk
mailing list