Windows toolbars
Hi Lispworkers
I am struggling with toolbars on LWW6 and Windows 7 and have two questions.
1. Size of toolbar-buttons
I would like toolbar-buttons larger than 16x16 pixels.
In capiref the following is stated regarding toolbar-button:
"Each image should be of the correct size for the toolbar. By
default, this is 16 pixels wide and 16 pixels high."
default, this is 16 pixels wide and 16 pixels high."
- Does this mean that 16x16 is a default value that you can change or is it not possible to use larger toolbar-buttons?
2. Change toolbar-button image
I can change toolbar-button images for normal toolbars, but not for toolbars attached to an interface.
Below is a small example of an interface with an attached toolbar and also a normal toolbar. In the normal toolbar, it is possible to change the images by clicking. The leftmost image is changed directly and the rightmost is changed by selection. What puzzles me is that I cannot change the images in the interface attached toolbar in the same manner.
- Any thoughts?
PS. Toggling the image in the interface attached toolbar works in LW6 for Mac OS X.
Best regards,
Sven
---
(capi:define-interface test-panel () ()
(:panes
(toolbar capi:toolbar
:items (list (make-instance 'capi:toolbar-component
:items (list (make-instance 'capi:toolbar-button
:image :std-undo
:callback 'toggle-image))
:callback-type :item)
(make-instance 'capi:toolbar-component
:items (list (make-instance 'capi:toolbar-button
:image :std-undo
:selected-image :std-redo))
:interaction :multiple-selection))))
(:layouts
(main-layout capi:simple-layout
'(toolbar)))
(:default-initargs
:toolbar-items (make-toolbar-items)))
(defun make-toolbar-items ()
(list (make-instance 'capi:toolbar-component
:items (list (make-instance 'capi:toolbar-button
:image :std-undo
:callback 'toggle-image))
:callback-type :item)
(make-instance 'capi:toolbar-component
:items (list (make-instance 'capi:toolbar-button
:image :std-undo
:selected-image :std-redo))
:interaction :multiple-selection)))
(defun toggle-image (item)
(setf (capi:toolbar-button-image item) (if (eq (capi:toolbar-button-image item) :std-redo)
:std-undo
:std-redo)))
(capi:display (make-instance 'test-panel))
---