-(define-foreign %toolbar-insert-element () widget
- (toolbar toolbar)
- (type toolbar-child-type)
- (widget (or null widget))
- (text string)
- (tooltip-text string)
- (tooltip-private-text string)
- (icon (or null widget))
- (nil null)
- (nil null)
- (position int))
-
-(defun toolbar-insert-element (toolbar position
- &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (let* ((icon-widget (typecase icon
- ((or null widget) icon)
- (t (pixmap-new icon))))
- (toolbar-child
- (%toolbar-insert-element
- toolbar (or type (and widget :widget) :button)
- widget text tooltip-text tooltip-private-text icon-widget
- (%toolbar-position-num toolbar position))))
- (when callback
- (signal-connect toolbar-child 'clicked callback))
- toolbar-child))
-
-(defun toolbar-append-element (toolbar &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (toolbar-insert-element
- toolbar :append :type type :widget widget :icon icon :text text
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
- :callback callback))
-
-(defun toolbar-prepend-element (toolbar &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (toolbar-insert-element
- toolbar :prepend :type type :widget widget :icon icon :text text
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
- :callback callback))
-
-(defun toolbar-insert-space (toolbar position)
- (toolbar-insert-element toolbar position :type :space))
-
-(defun toolbar-append-space (toolbar)
- (toolbar-insert-space toolbar :append))
-
-(defun toolbar-prepend-space (toolbar)
- (toolbar-insert-space toolbar :prepend))
-
-(defun toolbar-insert-widget (toolbar widget position &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-element
- toolbar position :widget widget :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-append-widget (toolbar widget &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-widget
- toolbar widget :append :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-prepend-widget (toolbar widget &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-widget
- toolbar widget :prepend :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-insert-item (toolbar text icon position &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-element
- toolbar position :text text :icon icon :callback callback
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text))
-
-(defun toolbar-append-item (toolbar text icon &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-item
- toolbar text icon :append :callback callback
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text))
-
-
-(defun toolbar-prepend-item (toolbar text icon &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-item
- toolbar text icon :prepend :callback callback
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text))
-
-(defun toolbar-enable-tooltips (toolbar)
- (setf (toolbar-tooltips-p toolbar) t))
-
-(defun toolbar-disable-tooltips (toolbar)
- (setf (toolbar-tooltips-p toolbar) nil))
-
-
-
-;;; Tree