<div dir="ltr"><div><div><div><div>Hi!<br><br></div>I've create a QMessageBox and tried to use clickedButton() to determine which button is clicked, like illustrated in QMessageBox::clickedButton ()'s document.<br>
<br></div>My function:<br><br>(defun yes-no-cancel-dialog (text informative-text yes-text no-text cancel-text)<br> (with-objects ((message-box (#_new QMessageBox)))<br> (#_setText message-box text)<br> (#_setInformativeText message-box informative-text)<br>
(let ((yes-button (#_addButton message-box yes-text (#_QMessageBox::YesRole)))<br> (no-button (#_addButton message-box no-text (#_QMessageBox::NoRole)))<br> (cancel-button (#_addButton message-box cancel-text (#_QMessageBox::RejectRole)))<br>
(clicked-button))<br> (#_exec message-box)<br> (setf clicked-button (#_clickedButton message-box))<br> (format t "clicked:~A~%" (#_clickedButton message-box))<br> (format t "clicked:~A~%" yes-button)<br>
(format t "clicked:~A~%" no-button)<br> (format t "clicked:~A~%" cancel-button)<br> (cond ((eq clicked-button yes-button) :yes)<br> ((eq clicked-button no-button) :no)<br>
((eq clicked-button cancel-button) :cancel)<br> (t nil)))))<br><br></div><div>When I click "yes" button, I can see something like:<br><br>clicked:#<QPushButton 0x02003E18><br>
clicked:#<QPushButton 0x02003E18><br>clicked:#<QPushButton 0x02004098><br>clicked:#<QPushButton 0x02004428><br><br></div>I tried eq, eql, equal and equalp, none of them return t when comparing clicked-button with yes-button. What can I do to compare two pointers?<br>
<br></div><div>Thanks in advance.<br></div><div><br></div>- Rujia<br><br></div>