How to create a pixmap scrollbar

# How to create a pixmap scrollbar for mlterm

## 1. Introduction

This document provides a simple guide for creating pixmap scrollbar for mlterm using a pixmap_engine plugin. The pixmap_engine has been a part of mlterm since version 2.8.0.

## 2. Image file

To create the pixmap scrollbar, you will need making images which construct a scrollbar as the below figure. The images must be formatted as PNG, and you must not change the file name. You need not make all images. For example, in case of the below figure, there are not bg_top.png and bg_bottom.png.

## 3. Location and 'rc' file

The pixmap scrollbar location is $PREFIX/share/mlterm/scrollbars/[scrollbar_name]/ or $HOME/.mlterm/scrollbars/[scrollbar_name]/. The first thing you will need to do is to put the file called 'rc' into the [scrollbar_name] directory. The 'rc' file is a simple text file. It has some parameters which configure how the pixmap scrollbar is shown. In the 'rc' file, lines starting with '#' are ignored and the first line must be the following line:

    engine = pixmap_engine

## 4. Parameter

For minimum configuration, you need the following parameters:

key | type | default | description
--- | --- | --- | ---
witdh | decimal number | 0 | width of scrollbar (pixel)
button_up_height | decimal number | 0 | height of button_up.png (pixel)
button_down_height | decimal number | 0 | height of button_down.png (pixel)
top_margin | decimal number | 0 | top margin for movable area of scrollbar (pixel)
bottom_margin | decimal number | 0 | bottom margin for movable area of scrollbar (pixel)

Also, for more flexible design, optional parameters are available.

key | type | default | description
--- | --- | --- | ---
button_layout | string | "none" | layout of button ("none", "northgravity", "southgravity")
bg_tile | string | "true" | bg_body.png is tiled or scaled ("true", "false")
slider_tile | string | "false" | slider_body.png is tiled or scaled ("true", "false")
bg_enable_trans | string | "false" | use transparent background ("true", "false")