Hi,<div>I've learnt something from trying to implement check-boxes, radio-buttons, and a bit more.</div><div>I'm sure I have tons more to learnt and I welcome feedback and criticism.</div><div>I attach a modified version of ccl/examples/cocoa/easygui/views.lisp.</div><div>The rubric goes:</div><div><br></div><div><div>#| Changes from ccl/examples/cocoa/easygui/views.lisp</div><div>Views know their parent. Views have list of subviews.</div><div>Views have nicknames.</div><div>Check-Box-View exists.</div><div>Radio-Button-View exists.</div><div>Additional symbols exported (they should be added to ccl/examples/cocoa/easygui/package.lisp)</div><div>Testbed code adapted from ccl/examples/cocoa/easygui/example/view-hierarchy.lisp is included.</div><div>Questionable changes have been made to the slider-view class definintion and its</div><div>initialize-view method, since I was getting compiler warnings. I may have misunderstood</div><div>the intent behind the original code, I don't use sliders (yet), proceed with caution!</div><div>|#</div><div><br></div><div>; -----------------------</div><div>; New stuff</div><div>;</div><div>; VIEW-SUBVIEWS               view                    { Method }</div><div>; VIEW-SUBVIEWS               window</div><div>;    Returns a list of the views immediately contained within a view.</div><div>;    Returns a list of the views immediately contained within the content-view</div><div>;      of a window.</div><div>;    Depends on views being added by ADD-1-SUBVIEW and removed by REMOVE-1-SUBVIEW,</div><div>;    which conveniently is how ADD-SUBVIEWS and REMOVE-SUBVIEWS work.</div><div>;</div><div>;</div><div>; VIEW-NAMED                 nickname view           { Method }</div><div>; VIEW-NAMED                 nickname window</div><div>;    Returns the view's subview that has the given nickname.</div><div>;    Returns the window's content-view's subview that has the given nickname.</div><div>;    If there is currently no such subview, NIL is returned.</div><div>;    If there are several, the most recently added one is returned.</div><div>;</div><div>;</div><div>; CHECK-BOX-VIEW                                     { Class }</div><div>;    A subtype of VIEW, a control that appears as a check-box, and may be on or off.</div><div>;    Specific initargs:</div><div>;      :CHECKED           [ Generalised Boolean ]    Default NIL</div><div>;    Specific methods:</div><div>;      CHECK-BOX-CHECKED-P          checkbox</div><div>;        Returns T if the checkbox is checked, NIL if not.</div><div>;      CHECK-BOX-CHECK              checkbox &optional perform</div><div>;      CHECK-BOX-UNCHECK            checkbox &optional perform</div><div>;        These methods cause the checkbox to become checked/unchecked respectively.</div><div>;        If the Perform argument is given and is non-nil, then if the checkbox is</div><div>;        changing state any action associated it will be run.</div><div>;      (SETF CHECK-BOX-CHECKED-P)   checkbox</div><div>;        Causes the checkbox to become checked or not, as per the new value supplied.</div><div>;        Since it calls either CHECK-BOX-CHECK or CHECK-BOX-UNCHECK, subclasses of</div><div>;        checkbox may specialise these methods to call-next-method with a</div><div>;        non-NIL PERFORM argument if that is desired.</div><div>;        </div><div>;</div><div>;</div><div>; RADIO-BUTTON-VIEW                                 { Class }</div><div>;    A subtype of VIEW, a control that appears as a radio-button, and interacts with</div><div>;      other radio-buttons in the same named cluster and within the same subview</div><div>;      in such a way that no more than one at a time may be selected.</div><div>;    Specific initargs:</div><div>;      :SELECTED         [ Generalised Boolean ]    Default NIL</div><div>;      :CLUSTER          [ Any ]                    Default a unique constant</div><div>;    Specific methods:</div><div>;      RADIO-BUTTON-SELECTED-P      radiobutton</div><div>;        Returns T if the radiobutton is selected, NIL otherwise.</div><div>;      RADIO-BUTTON-SELECT          radiobutton &optional perform</div><div>;        Causes the button to be selected, all other buttons in the same cluster</div><div>;        and contained in the same view become deselected. If the Perform argument is</div><div>;        supplied and non-NIL, then any action associated with the button is performed.</div><div>;        If there is only one cluster of buttons in a view, no name for the cluster</div><div>;        need be provided. If there is more than one cluster, cluster names</div><div>;        (keywords for example) should be used to identify which buttons go together.</div><div>;      RADIO-BUTTON-DESELECT        radiobutton &optional perform</div><div>;        Causes the button to be deselected. If the Perform argument is</div><div>;        supplied and non-NIL, then any action associated with the button is performed.</div><div>;        It is permissible for no button of a cluster to be selected.</div><div>;    Note, if several buttons are specified with :SELECTED T when added, only the</div><div>;    last one added will show as selected in fact. In the process of adding it, others</div><div>;    will have been deselected.</div><div><br></div><div><br></div><div><br></div><div>As I say, feedback and criticism are welcome.</div><div>Arthur</div></div>