-(defmethod shared-initialize ((combo combo) names &rest initargs
- &key popdown-strings)
- (declare (ignore initargs))
- (call-next-method)
- (when popdown-strings
- (combo-set-popdown-strings combo popdown-strings)))
-
-(defbinding combo-set-popdown-strings () nil
- (combo combo)
- (strings (glist string)))
+(defmethod shared-initialize ((combo-box combo-box) names &key model content)
+ (unless model
+ (setf
+ (combo-box-model combo-box)
+ (make-instance 'list-store :columns '(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 shared-initialize :after ((combo-box combo-box) names &key active)
+;; (when active
+;; (signal-emit combo-box 'changed)))
+
+(defbinding combo-box-append-text () nil
+ (combo-box combo-box)
+ (text string))
+
+(defbinding combo-box-insert-text () nil
+ (combo-box combo-box)
+ (position int)
+ (text string))
+
+(defbinding combo-box-prepend-text () nil
+ (combo-box combo-box)
+ (text string))
+
+#+gtk2.6
+(defbinding combo-box-get-active-text () string
+ (combo-box combo-box))