<div dir="ltr">In particular, how to know whether a pointer is actually NULL? I noticed that it's not converted to CL's nil, but a wrapper that contains the NULL pointer inside.<br><br>Of course I can hack it by checking whether (format nil "~A" the-pointer) contains the substring null, but I think there should be a better solution.<br>
<br>Thanks in advance!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 13, 2013 at 5:39 PM, Rujia Liu <span dir="ltr"><<a href="mailto:rujia.liu@gmail.com" target="_blank">rujia.liu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>- Rujia<br><br></font></span></div>
</blockquote></div><br></div>