[pygtk] Re: Using adjustments to 'remember' treeview's position

Andrew Conkling andrew.conkling at gmail.com
Wed Sep 21 02:45:19 WST 2005

On 9/20/05, Brian Campbell <bcampbel at tripos.com> wrote:
> When you call get_adjustment(), you get a REFERENCE to an adjustment.  If
> you change context while holding that reference, the adjustment underneath
> it changes also (or the adjustment changes, which invalidates the
> reference), so calling set_adjustment() doesn't do anything.  But, if you
> call get_value(), you get an integer, which merely describes the offset of
> the slider bar in the adjustment, which you can set, via set_value(), to any
> legal value between adj.lower and (adj.higher-adj.page_size).  I think this
> is what you are trying to do (say, browse a directory, then go 'back' to the
> previous context, with the same scroll position as before?)

Yes, this is what I am trying to do.  With this in mind, I went back
and read about adjustments and realized that I'd have to do something
like what you just described.  I think I'll just define the adjustment
when I load the window (and its treeview); that way, I have a
persistent name for it when I call my browse function.

Thanks for the direction; I *hope* to be alright at this point.  But
the question is: which glaring documentation will I grossly
misunderstand next? O_o



More information about the pygtk mailing list