Lisp HUG Maillist Archive

uniform size buttons

I'm wondering if there is an easier way to get uniform size buttons and 
still define the buttons individually in the :panes section of the 
interface. What I would like to have is:

....
(:panes
  (new
   push-button
   :text "New")
  (open
   push-button
   :text "Open"))
(:layouts
  (buttons column-layout '(new open) :x-uniform-size-p t))
....

But the buttons are not uniform size. The only way I have found to do 
this is to create a button-panel in the :panes section:

(buttons
     push-button-panel
     :items (list "New" "Open")
     :layout-args '(:x-uniform-size-p t)
     :layout-class 'column-layout)

But with this approach I could not find a documented way to get access 
to the button instances (I need to enable/disable buttons based on the 
state of other interface elements).

Thanks for any suggestions.

John DeSoi, Ph.D.


Re: uniform size buttons

The code below appears to do what you want using a button panel (as I 
understand the question :-):
pt


(in-package "COMMON-LISP-USER")

(capi:define-interface interface-1 ()
  ()
  (:panes
   (push-button-panel-2
    capi:push-button-panel
    :items '("New" "Open")
    :max-height t
    :accessor bpanel
    :max-width t))
  (:layouts
   (column-layout-1
    capi:column-layout
    '(push-button-panel-2)))
  (:default-initargs
   :best-height 69
   :best-width 111
   :layout 'column-layout-1
   :title "Interface-1"))

(defun test ()
(let ((xx (capi:display (make-instance 'interface-1))))
 (capi:set-button-panel-enabled-items (bpanel xx) :disable '("Open") :set t)))


Re: uniform size buttons

Unable to parse email body. Email id is 2396

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