Easy scrolling of ScrolledWindow



Currently if I want to scroll a ScrolledWindow down a page, I have to
apply (in perl; I imagine C would be analogous):

   my $adj = $scrollwindow->get_vadjustment;

   my $newval = $adj->value + $adj->page_increment;
   my $max = $adj->upper - $adj->page_size;
   # Check we don't go too far
   $newval = $max if $newval > $max;
   $adj->set_value( $newval );

This is, shall we say, inconvenient.

Before I go hacking code, would anyone object to an API something like:

  $adj->scroll_page(1);
  $adj->scroll_page(GTK_DOWN);

Or even

  $scrollwindow->scroll(GTK_DOWN);

-- 
Paul "LeoNerd" Evans

leonerd leonerd org uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: Digital signature



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