Browse files

Fixed the font-selector demo so that it doesn't crash. The problem

was that when the family changes, it tries to initialize the face to
one with the same name as the selected one in the old family.  When
there is no such face in the new family, it got initialized to nil.

However, the demo is still not working properly.  Sometimes a
displayed face becomes non-clickable, and sometimes two faces are
highlighted simultaneously.
  • Loading branch information...
1 parent 1a7b913 commit ebff70c9f5689d3ae02be0add330726c86f9f399 Robert Strandh committed Dec 8, 2009
Showing with 5 additions and 4 deletions.
  1. +5 −4 Examples/font-selector.lisp
@@ -99,10 +99,11 @@
(reset-list-pane face-list new-faces)
(when old-face
(setf (gadget-value face-list :invoke-callback t)
- (find (font-face-name old-face)
- new-faces
- :key #'font-face-name
- :test #'equal)))))
+ (or (find (font-face-name old-face)
+ new-faces
+ :key #'font-face-name
+ :test #'equal)
+ (first new-faces))))))
(defun face-changed (pane value)
(declare (ignore pane))

0 comments on commit ebff70c

Please sign in to comment.