FLvalue

FLvalue — Shows the current value of a FLTK valuator.

Description

FLvalue shows current the value of a valuator in a text field.

Syntax

ihandle FLvalue "label", iwidth, iheight, ix, iy

Initialization

ihandle -- handle value (an integer number) that unequivocally references the corresponding valuator. It can be used for the idisp argument of a valuator.

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

iwidth -- width of widget.

iheight -- height of widget.

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

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

Performance

Note that FLvalue is not a valuator and its value is fixed. Its value cannot be modified.

FLvalue shows the current values of a valuator in a text field. It outputs ihandle that can then be used for the idisp argument of a valuator (see the FLTK Valuators section). In this way, the values of that valuator will be dynamically be shown in a text field.

Examples

Here is an example of the FLvalue opcode. It uses the files FLvalue.orc and FLvalue.sco.

Example 143. Example of the FLvalue opcode.

/* flvalue.orc */
; Using the opcode flvalue to display the output of a slider 
sr = 44100
kr = 441
ksmps = 100
nchnls = 1

FLpanel "Value Display Box", 900, 200, 50, 50
    ; Width of the value display box in pixels
    iwidth = 50
    ; Height of the value display box in pixels
    iheight = 20
    ; Distance of the left edge of the value display
    ; box from the left edge of the panel
    ix = 65
    ; Distance of the top edge of the value display
    ; box from the top edge of the panel
    iy = 55

    idisp FLvalue "Hertz", iwidth, iheight, ix, iy
    gkfreq, ihandle FLslider "Frequency", 200, 5000, -1, 5, idisp, 750, 30, 125, 50
    FLsetVal_i 500, ihandle
; End of panel contents
FLpanelEnd
; Run the widget thread!
FLrun

instr 1
    iamp = 15000
    ifn = 1
    asig oscili iamp, gkfreq, ifn
    out asig
endin
/* flvalue.orc */

        
/* flvalue.sco */
; Function table that defines a single cycle
; of a sine wave.
f 1 0 1024 10 1

; Instrument 1 will play a note for 1 hour.
i 1 0 3600
e
/* flvalue.sco */

        

See Also

FLbox, FLbutBank, FLbutton, FLprintk, FLprintk2

Credits

Author: Gabriel Maldonado

New in version 4.22

Example written by Iain McCurdy, edited by Kevin Conder.