Marc R.J. Brevoort wrote:
> On Wed, 1 Sep 2010, Albrecht Schlosser wrote:
> 
>>> is there any way to programmatically scroll an
>>> Fl_Help_View all the way down?
> 
>> void Fl_Help_View::topline (int top)
>> I didn't test/use it, but the docs say:
>> "If the given pixel value top is out of range, then the text is scrolled
>> to the top or bottom of the document, resp."
>> Thus, setting a very high top value ought to do it.
> 
> That worked- sort of. Actually it scrolls so far down
> then that the content of the screen scrolls off the
> top of the screen.

        I think topline() uses size() to determine the max,
        so if you use help->topline(help->size() - help->h());
        this would probably get you right to the bottom. eg:

#include <FL/Fl_Window.H>
#include <FL/Fl_Help_View.H>
int main(int argc, char *argv[]) {
  if ( argc < 2 )
    { fprintf(stderr, "usage: %s /path/to/foo.html\n", argv[0]); exit(1); }
  Fl_Window win(300,300);
  Fl_Help_View *help;
  help = new Fl_Help_View(10,10,300-20,300-20);;
  help->load(argv[1]);
  help->topline(help->size() - help->h());              // <<<--------------
  win.end();
  win.resizable(win);
  win.show();
  Fl::run();
  return(0);
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to