[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: editable-text-dialog-item and cut&paste

>In running MCL2.0p2 with editable-text-dialog-items in a _modal_ dialog.
>In the MCL Reference, that chapter on dialog items and dialogs seems to 
>imply that cut and paste functions for editable-text-dialog-items are 
>already existing and auto-magically available. That is, the book states "The 
>user can give standard Macintosh commands to edit the text of such 
>{editable-text} items."  I assume the book means these features are 
>automagically available since I cannot find any documentation on how to 
>_make_ them available.
>However, in all of my modal dialogs the "Edit" menu is greyed out.  How do I 
>make it available (perferably _without_ going in and writing cut&paste 
>functions on a new dialog class which has to track its own editable-text 
>dialog items)?
>Making the "edit" menu available is done in the standard dialog 
>"get-string-from-user."  This is what I would like to be able to do.

The "Edit" menu works perfectly for me in the dialog generated by the
following code. What doesn't work for you?

Welcome to Macintosh Common Lisp Version 2.0!
? (modal-dialog
   (make-instance 'dialog
     (list (make-instance 'editable-text-dialog-item
             :view-nick-name :text
             :dialog-item-text "Default text")
           (make-instance 'default-button-dialog-item
             :dialog-item-text "OK"
             #'(lambda (item)
                 (let ((text (find-named-sibling item :text)))
                    (dialog-item-text text))))))))
"Default text"