[erlang-questions] Mysterious wxDialog:showModal/1 return value

Michael Turner michael.eugene.turner@REDACTED
Mon Apr 11 13:41:48 CEST 2011


The documentation for wxDialog:showModal/1 promises (indirectly, anyway)
that

  "The return value is the value set with
wxDialog::SetReturnCode<http://docs.wxwidgets.org/stable/wx_wxdialog.html#wxdialogsetreturncode>
."

See http://docs.wxwidgets.org/stable/wx_wxdialog.html#wxdialogshowmodal
<http://docs.wxwidgets.org/stable/wx_wxdialog.html#wxdialogshowmodal>
But wxWidgets (at least as of R14B on Windows) doesn't seem to keep that
promise.

I put these lines into the shell:

  Wx= wx:new().
  F = wxFrame:new(Wx, -1, "A frame").
  wxFrame:show(F).
  D = wxMessageDialog:new (F, "Let's talk.").

When I asked for this:

  wxDialog:getReturnCode(D).

I got 0 (zero).  When I set it to 1

  wxDialog:setReturnCode(D,1).

I got "ok".  When I asked to see the value I'd set

  wxDialog:getReturnCode(D).

I got back 1 -- as I'd asked.  But when I did

   wxDialog:showModal(D).

and hit the OK button, the return value was 5100.

Why?  Is there some reason for this?  For my wxWidgets tutorial

  http://www.idiom.com/~turner/wxtut/wxwidgets.html

even if I'm stuck with 5100, I'd like, at the very least, to be able to
explain why it's 5100.  Does anybody know?

-michael turner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110411/c26d8fb6/attachment.htm>


More information about the erlang-questions mailing list