FLscroll

FLscroll — A FLTK opcode that adds scroll bars to an area.

Description

FLscroll adds scroll bars to an area.

Syntax

FLscroll iwidth, iheight [, ix] [, iy]

Initialization

iwidth -- width of widget.

iheight -- height of widget.

ix (optional) -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).

iy (optional) -- vertical position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels).

Performance

Containers are useful to format the graphic appearance of the widgets. The most important container is FLpanel, that actually creates a window. It can be filled with other containers and/or valuators or other kinds of widgets.

There are no k-rate arguments in containers.

FLscroll adds scroll bars to an area. Normally you must set arguments iwidth and iheight equal to that of the parent window or other parent container. ix and iy are optional since they normally are set to zero. For example the following code:

         FLpanel    "PanelPluto",400,300,100,100
         FLscroll   400,300
gk1, ih1 FLslider   "FLslider 1", 500, 1000, 2 ,1, -1, 300,15, 20,50
gk2, ih2 FLslider   "FLslider 2", 300, 5000, 2 ,3, -1, 300,15, 20,100
gk3, ih3 FLslider   "FLslider 3", 350, 1000, 2 ,5, -1, 300,15, 20,150
gk4, ih4 FLslider   "FLslider 4", 250, 5000, 1 ,11,-1, 300,30, 20,200
         FLscrollEnd
         FLpanelEnd

will show scroll bars, when the main window size is reduced:

FLscroll.

FLscroll.

Examples

Here is an example of the FLscroll opcode. It uses the file FLscroll.csd.

Example 281. Example of the FLscroll opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in    No messages
-odac           -iadc     -d     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o FLscroll.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; Demonstration of the flscroll opcode which enables
; the use of widget sizes and placings beyond the
; dimensions of the containing panel
sr = 44100
kr = 441
ksmps = 100
nchnls = 1

FLpanel "Text Box", 420, 200, 50, 50
    iwidth = 420
    iheight = 200
    ix = 0
    iy = 0
    FLscroll iwidth, iheight, ix, iy
    ih3 FLbox "DRAG THE SCROLL BAR TO THE RIGHT IN ORDER TO READ THE REST OF THIS TEXT!", 1, 10, 20, 870, 30, 10, 100
    FLscrollEnd 
; End of panel contents
FLpanelEnd
; Run the widget thread!
FLrun

instr 1
endin


</CsInstruments>
<CsScore>

; 'Dummy' score event of 1 hour.
f 0 3600
e


</CsScore>
</CsoundSynthesizer>


See Also

FLgroup, FLgroupEnd, FLpack, FLpackEnd, FLpanel, FLpanelEnd, FLscrollEnd, FLtabs, FLtabsEnd

Credits

Author: Gabriel Maldonado

New in version 4.22

Example written by Iain McCurdy, edited by Kevin Conder.