Lisp HUG Maillist Archive

stupid CAPI question

Hello,
i need to know how to move with push-button.

For example, on opened window, operate with buttons and other elements  
(radiobutton, etc...).
By "operate" i mean add new, delete existing, move with existing.

I know, how to do it with circles and others, but with buttons, no  
way... :(

  Please, can anybody help me?

Thanks

Zed

  
  


Re: stupid CAPI question

(capi:define-interface button-test ()
   ()
   (:panes
    (push-button-1
     capi:push-button
     :x 73
     :y 66
     :text "First Button"))
   (:layouts
    (pinboard-layout-1
     capi:pinboard-layout
     '(push-button-1)
     :accessor layout))
   (:default-initargs
    :best-height 300
    :best-width 300
    :layout 'pinboard-layout-1
    :title "Interface-1"))

(defun delete-buttons (layout)
   (setf (capi:layout-description layout) nil))

(defun add-button (layout x y name)
   (push (list (make-instance 'capi:push-button :x x :y y :text name))
         (capi:layout-description layout)))

;;; -------------------------------------------------------------------
;;; Test:

(setf x (capi:display (make-instance 'button-test)))

(capi:apply-in-pane-process x #'add-button (layout x) 80 20 "Second")
(capi:apply-in-pane-process x #'add-button (layout x) 10 200 "Third")

(capi:apply-in-pane-process x #'delete-buttons (layout x))


Mitch


Updated at: 2020-12-10 08:43 UTC