Re: GtkAdjustment & scrolling



On Thu, 2007-11-01 at 10:27 +0100, Enno Fennema wrote:

> I'll try to answer my own question
> 
> > When should I set increment values to be retained and used for scrolling.
> After all window sizes have been calculated. I suffered from some 
> resizing late in the program which reset the values I carefully 
> calculated too early.

Nice co-incidence. I just figured this out myself, after quite a bit of
not knowing WTF was wrong. The easiest way I've found to do the
scrolling is to set up an idle timer to do it. eg ( in gtk2-perl ):

Glib::Idle->add( sub {
  my $adjustment = $self->{treeview}->get_vadjustment;
  my $upper = $adjustment->upper;
  $adjustment->set_value( $upper - $adjustment->page_increment -
$adjustment->step_increment );
  }
);

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]