FLpanel
Prev | Orchestra Opcodes and Operators | Next

## FLpanel

FLpanel — Creates a window that contains FLTK widgets.

## Description

Plugin opcode in widgets. This opcode is part of the plugin repository and has to be installed separately. These FLTK widgets do not work on the Mac. The plugin repository can be found here: https://github.com/csound/plugins

Creates a window that contains FLTK widgets.

## Syntax

    FLpanel "label", iwidth, iheight [, ix] [, iy] [, iborder] [, ikbdcapture] [, iclose]

## Initialization

“label” -- a double-quoted string containing some user-provided text, placed near the corresponding widget.

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).

iborder (optional) -- border type of the container. It is expressed by means of an integer number chosen from the following:

- 0 - no border

- 1 - down box border

- 2 - up box border

- 3 - engraved border

- 4 - embossed border

- 5 - black line border

- 6 - thin down border

- 7 - thin up border

ikbdcapture (default = 0) -- If this flag is set to 1, keyboard events are captured by the window (for use with sensekey and FLkeyIn)

iclose (default = 0) -- If this flag is set to anything other than 0, the close button of the window is disabled, and the window cannot be closed by the user directly. It will close when csound exits.

## 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.

FLpanel creates a window. It must be followed by the opcode FLpanelEnd when all widgets internal to it are declared. For example:

             FLpanel    "PanelPluto",450,550,100,100 ;***** start of container
    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
             FLpanelEnd ;***** end of container

will output the following result:

FLpanel.

If the ikbdcapture flag is set, the window captures keyboard events, and sends them to all sensekey. This flag modifies the behavior of sensekey, and makes it receive events from the FLTK window instead of stdin.

## Examples

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

Example 329. Example of the FLpanel 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 FLpanel.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; Creates an empty window panel
    sr = 44100
    kr = 441
    ksmps = 100
    nchnls = 1

    ; Panel height in pixels
    ipanelheight = 900
    ; Panel width in pixels
    ipanelwidth = 400
    ; Horizontal position of the panel on screen in pixels
    ix = 50
    ; Vertical position of the panel on screen in pixels
    iy = 50

    FLpanel "A Window Panel", ipanelheight, ipanelwidth, ix, iy
    ; 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, FLpanelEnd, FLscroll, FLscrollEnd, FLtabs, FLtabsEnd, sensekey

## Credits

Author: Gabriel Maldonado

New in version 4.22

Example written by Iain McCurdy, edited by Kevin Conder.

Prev | Up | Next
FLpack_end | Home | FLpanelEnd