[mcclim-devel] How to change color of a text field

Andy Hefner ahefner at gmail.com
Thu Apr 21 02:43:16 UTC 2005


I've worked out how to do this, with luck it works for what you're trying to 
do.

Here is an example:



(defun color-text-field (ink)
(let ((pane (find-pane-named *application-frame* 'text-field)))
;; The Goatee screen area keeps track of its own foreground color.
(setf (goatee::foreground-ink (climi::area pane)) ink)
;; The cursor is still drawn in foreground ink of the sheet-medium.
(setf (medium-foreground pane) ink)
;; Now force repaint of the sheet
(repaint-sheet pane (sheet-region pane))))


(defun red-text-field (gadget)
(color-text-field +red+))

(defun green-text-field (gadget)
(color-text-field +green+))

(define-application-frame colored-text-editing ()
()
(:panes
(text-field :text-field)
(red-button :push-button :activate-callback 'red-text-field :label "Redify")
(green-button :push-button :activate-callback 'green-text-field :label 
"Greenicate"))
(:layouts
(default
(vertically ()
text-field
(horizontally ()
red-button
green-button)))))





On 4/19/05, Paolo Amoroso <amoroso at mclink.it> wrote:
> 
> How can I change the color of the text displayed in a text field?
> Does the CLIM specification allow this?
> 
> Paolo
> --
> Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log
> _______________________________________________
> mcclim-devel mailing list
> mcclim-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050420/c3deb286/attachment.html>


More information about the mcclim-devel mailing list