xscrollcommand

Specifies function body for a command used to communicate with horizontal scrollbars.

When the view in the widget's window changes (or whenever anything else occurs that could change the display in a scrollbar, such as a change in the total size of the widget's contents), the widget will generate command call by the lambda body and two numbers.

Each of the numbers is a fraction between 0 and 1, which indicates a position in the document. 0 indicates the beginning of the document, 1 indicates the end, .333 indicates a position one third the way through the document, and so on. The first fraction indicates the first information in the document that is visible in the window, and the second fraction indicates the information just after the last portion that is visible.

The lambda expression must have 2 arguments, e. g.

(#<widget> 'configure 
   #:xscrollcommand
   (let ((vscroll (#<widget> 'create-widget 'scrollbar #:orient 'horizontal)))
      (vscroll 'pack #:side bottom)
      (lambda (num1 num2)
         (vscroll 'set num1 num2))))

The resulting lambda expression is then passed to Chicken with the two numbers as arguments.


© Author | Home | Sitemap