Lisp HUG Maillist Archive

Push-button Question

Hi,

I am trying to set the foreground and background colors in a push-button. Here is the sample code:

 

(defparameter *font* (gp:make-font-description :family "Verdana" :size 14 :weight :medium :slant :roman))

 

(defun test-buttons ()

  (let ((b1 (make-instance 'capi:push-button :text "Button1" :font *font* :foreground :navyblue

                           :background :white ))

        (b2 (make-instance 'capi:push-button :text "Button2")))

    (capi:contain (make-instance 'capi:push-button-panel  :items (list b1 b2)))))

 

When I run (test-buttons) at the Listener, I can see the buttons, but “Button1” does not appear in the correct color.

 

Any ideas?

 

Regards,

Rangarajan

 

Re: Push-button Question

What platform? I'd bet your hitting this:

http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-408.htm#marker-1628962

Look at notes, #1:

  1.  foreground is ignored for buttons on Windows and Cocoa.
 
Jeff M.

Rangarajan Krishnamoorthy
Thursday, January 9, 2014 5:34 AM

Hi,

I am trying to set the foreground and background colors in a push-button. Here is the sample code:

 

(defparameter *font* (gp:make-font-description :family "Verdana" :size 14 :weight :medium :slant :roman))

 

(defun test-buttons ()

  (let ((b1 (make-instance 'capi:push-button :text "Button1" :font *font* :foreground :navyblue

                           :background :white ))

        (b2 (make-instance 'capi:push-button :text "Button2")))

    (capi:contain (make-instance 'capi:push-button-panel  :items (list b1 b2)))))

 

When I run (test-buttons) at the Listener, I can see the buttons, but “Button1” does not appear in the correct color.

 

Any ideas?

 

Regards,

Rangarajan

 

Updated at: 2020-12-10 08:34 UTC