Lisp HUG Maillist Archive

changing icon image under LWW

I want to change the image used in the upper left-hand corner of the window's 
title bar (and of the icon in iconified mode) under LWW4.4.6, but I don't see 
in the docs something that will do this.  Does anybody know how to accomplish 
this and tell me where I should be looking?

thanx
pt


Re: changing icon image under LWW

On Wed, 11 Oct 2006 18:03:20 -0400, Paul Tarvydas <tarvydas@visualframeworksinc.com> wrote:

> I want to change the image used in the upper left-hand corner of the
> window's title bar (and of the icon in iconified mode) under
> LWW4.4.6, but I don't see in the docs something that will do this.
> Does anybody know how to accomplish this and tell me where I should
> be looking?

For a delivered application the icon you specify during delivery will
be used for both:

  http://www.lispworks.com/documentation/lw50/DV/html/deluser-97.htm

If you want to achieve this effect from within the Lisp image, I have
no idea how to do that.

Cheers,
Edi.


Re: changing icon image under LWW

Hello Paul,

| I want to change the image used in the upper left-hand corner of the
| window's title bar (and of the icon in iconified mode) under LWW4.4.6,
| but I don't see in the docs something that will do this.  Does anybody
| know how to accomplish this and tell me where I should be looking?

Here is an excerpt from the Ystok-Widgets library
(http://lisp.ystok.ru/projects.html, file capi-hacks.lisp).

(defmacro define-icons (type &key icon-data icon-small-data)
;;; Args: type Symbol, an interface class name.
  `(progn (setf (get ',type :icon-data) ,icon-data
                (get ',type :icon-small-data) ,icon-small-data
                *icon-interface-types* (adjoin ',type
*icon-interface-types*))
     (defmethod CAPI::CAPI-INTERFACE-WINDOW-CLASS ((self ,type))
       (symbol-name ',type))
     (%register-icons ',type)  ; (eval-when (:load-toplevel) ...) for
debugging
     ',type))

(defun %register-icons (&optional (list *icon-interface-types*))
  (dolist (type (listify list))
    #+win32 (WW::REGISTER-WINDOW-ATTRIBUTES (symbol-name type)
               :icon-data (get type :icon-data)
               :icon-small-data (get type :icon-small-data)))) ; does not
work in LW4.4.5?

;;; Usage example
(ywi:define-icons event-face
    :icon-data #.(win32:read-icon-file-data
                  (lw:current-pathname "images/event-32x32.ico"))
    :icon-small-data #.(win32:read-icon-file-data
                        (lw:current-pathname "images/event-16x16.ico")))

You can also find the second way of changing icons dynamically there.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


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