+(define-toplevel create-statusbar (window "Statusbar")
+ (let ((statusbar (make-instance 'statusbar :has-resize-grip t))
+ (close-button (create-button '("close" :can-default t)
+ #'widget-destroy :object window))
+ (counter 0))
+
+ (signal-connect statusbar 'text-popped
+ #'(lambda (context-id text)
+ (declare (ignore context-id))
+ (format nil "Popped: ~A~%" text)))
+
+ (make-instance 'v-box
+ :parent window
+ :child (make-instance 'v-box
+ :border-width 10 :spacing 10
+ :child (create-button "push something"
+ #'(lambda ()
+ (statusbar-push statusbar 1
+ (format nil "something ~D" (incf counter)))))
+ :child (create-button "pop"
+ #'(lambda ()
+ (statusbar-pop statusbar 1)))
+ :child (create-button "steal #4"
+ #'(lambda ()
+ (statusbar-remove statusbar 1 4)))
+ :child (create-button "dump stack")
+ :child (create-button "test contexts"))
+ :child (list (make-instance 'h-separator) :expand nil)
+ :child (list
+ (make-instance 'v-box :border-width 10 :child close-button)
+ :expand nil)
+ :child (list statusbar :expand nil))
+
+ (widget-grab-focus close-button)))