-(defmethod shared-initialize ((combo-box combo-box) names &key model content)
- (unless model
- (setf
- (combo-box-model combo-box)
- (make-instance 'list-store :column-types '(string)))
- (unless (typep combo-box 'combo-box-entry)
- (let ((cell (make-instance 'cell-renderer-text)))
- (cell-layout-pack combo-box cell :expand t)
- (cell-layout-add-attribute combo-box cell :text 0)))
- (when content
- (map 'nil #'(lambda (text)
- (combo-box-append-text combo-box text))
- content)))
- (call-next-method))
+(defmethod initialize-instance ((combo-box combo-box) &rest initargs
+ &key model content active)
+ (remf initargs :active)
+ (if model
+ (apply #'call-next-method combo-box initargs)
+ (progn
+ (apply #'call-next-method combo-box
+ :model (make-instance 'list-store :column-types '(string))
+ initargs)
+ (unless (typep combo-box 'combo-box-entry)
+ (let ((cell (make-instance 'cell-renderer-text)))
+ (cell-layout-pack combo-box cell :expand t)
+ (cell-layout-add-attribute combo-box cell :text 0)))))
+ (when content
+ (mapc #'(lambda (text)
+ (combo-box-append-text combo-box text))
+ content))
+ (when active
+ (setf (combo-box-active combo-box) active)))
+