Take an example. We want display an ASCII text in a window. In this context, the variable ypos is exactly the index of the first line displayed in the window and the variable xpos is the first column displayed in the window (we suppose we use a non proportional font to display the text). So the variable ypos_max represents the number of lines of the text and the variable xpos_max should the size of the largest line or a fixed number like 255, to have it easyer. The variable h_u represents the height of a character cell and the variable w_u is the width of a character cell. When the window is opened, the variables xpos and ypos should be zero. The following figure picture the situation.
(0,0) xpos_max ----------------Text------------------ | | <- Top of the text. | ======= Window ======= | |Hello g|uy.Nice to meet you |<-ypos | | | _ | | | | |c| <- h_u | | | | ^---- w_h | | | | | | | ---------------------- | | xpos---^ | | | .->| | <- Botton of the text | -------------------------------------- ypos_maxThis variables are set when the window is created. Then, the function WindSlider() sets the size and position of the sliders according to the variables previously described. Usually, the function WindSlider() is used when you change the value of a slider variable. In other cases, the event standard function calls WindSlider(). The previous subsection Non proportional window gives a complet example with sliders.