[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
user-pick-color
- To: arie@dip.eecs.umich.edu
- Subject: user-pick-color
- From: alms@cambridge.apple.com (Andrew L. M. Shalit)
- Date: Mon, 21 May 90 14:16:36 -0400
- Cc: bug-macl, info-macl
- In-reply-to: Arie Covrigaru's message of Mon, 21 May 90 13:09:33 -0400 <9005211709.AA27608@dip.eecs.umich.edu>
Arie -
thanks for the bug report. Here's the code user-pick-color, extended
to accept a position argument (actually, all the args have been turned
into keyword args).
-andrew
-------------
(defun user-pick-color (&key (color *black-color*)
(prompt "Pick a color")
(position #@(40 100)))
"lets the user choose a color with the standard mac window"
(with-cursor *arrow-cursor*
(if *color-available*
(with-rgb (rgb color)
(with-pstrs ((pp prompt))
(if (logbitp 8 (_GetColor :long position
:ptr pp
:ptr rgb
:ptr rgb
:word))
(rgb-to-color rgb)
(throw-cancel))))
(if (y-or-n-dialog prompt
:yes-text "Black"
:no-text "White")
*black-color*
*white-color*))))