# $window-mode-line(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$window-mode-line - Window mode line position
$window-scroll-bar - Window scroll bar (or separator) position

## SYNOPSIS

$window-mode-line integer

1 <= integer <= $frame-depth - 2

$window-scroll-bar integer

0 <= integer <= $frame-width - 1

## DESCRIPTION

$window-mode-line stores the screen line of the current windows mode-line, where screen lines are counted from 0 at the top of the screen. Often used in conjunction with set-cursor-to-mouse(2) and $mouse-y(5) to add more complex mouse functionality.

$window-scroll-bar stores the screen position of the right-hand horizontal window separator line or scroll-bar (see split-window-horizontally(2) and $scroll-bar(5)). A value of greater than $frame-width(5) indicates that there is no right-hand separator column or scroll bar present. Often used in conjunction with $mouse-x(5).

## EXAMPLE

In the following example the position of the mouse is checked to see if it is on the mode line of the window, if so then a different action is taken.

    set-cursor-to-mouse
    ;   If we are on the mode line then interpret position of
    ;   the cursor on line to control the screen.
    !if &equal $window-mode-line $mouse-y
        !if &less $mouse-x "2"
            menu-main     ; Inform buffer to pop up menu.
        !elif &equal $mouse-x "2"
            delete-window
        !elif &equal $mouse-x "3"
            delete-other-windows
        !elif &equal $mouse-x "4"
            backward-page
        !elif &equal $mouse-x "5"
            forward-page
        !elif &equal $mouse-x "6"
            recenter
        !elif &equal $mouse-x "7"
            undo
        !endif
    !else
        .....
    !endif

## SEE ALSO

$mode-line(5), $mouse-x(5), $mouse-y(5), $scroll-bar(5), $mouse-pos(5), set-cursor-to-mouse(2), split-window-horizontally(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>