diff options
Diffstat (limited to 'ipl/gprogs/colrpick.icn')
-rw-r--r-- | ipl/gprogs/colrpick.icn | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ipl/gprogs/colrpick.icn b/ipl/gprogs/colrpick.icn new file mode 100644 index 0000000..a8c90f2 --- /dev/null +++ b/ipl/gprogs/colrpick.icn @@ -0,0 +1,70 @@ +############################################################################ +# +# File: colrpick.icn +# +# Subject: Program to pick RGB or HLS colors +# +# Author: Gregg M. Townsend +# +# Date: February 27, 1995 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# colrpick provides a command-level interface to the ColorDialog +# procedure. The ColorValue() of the selected color is written to +# standard output when the Okay button is pressed. If the Cancel +# button is pressed, colorpick exits with an error by calling stop(). +# +# A default color can be specified by one or more command arguments, +# for example "colrpick deep green". +# +############################################################################ +# +# Requires: Version 9 graphics +# +############################################################################ +# +# Links: graphics, vsetup +# +############################################################################ + +link graphics +link vsetup + +procedure main(args) + local dflt + + Window ! put(ui_atts(), "canvas=hidden", args) + ui() # just to get standard VIB font + + if *args > 0 then { + dflt := "" + every dflt ||:= " " || !args + if not ColorValue(dflt) then { + write(&errout, " illegal default color: ", dflt) + dflt := &null + } + } + + case ColorDialog(, dflt) of { + "Okay": write(dialog_value) + "Cancel": stop() + } +end + + +#===<<vib:begin>>=== modify using vib; do not remove this marker line +procedure ui_atts() + return ["size=340,320", "bg=pale gray"] +end + +procedure ui(win, cbk) +return vsetup(win, cbk, + [":Sizer:::0,0,340,320:",], + ) +end +#===<<vib:end>>=== end of section maintained by vib |