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

Dan Gudmundsson dgud@REDACTED
Mon Apr 11 14:30:40 CEST 2011


I don't know how it's supposed to work but from wx.hrl
-define(wxID_OK, 5100).

/Dan

On Mon, Apr 11, 2011 at 1:41 PM, Michael Turner
<michael.eugene.turner@REDACTED> wrote:
> The documentation for wxDialog:showModal/1 promises (indirectly, anyway)
> that
>   "The return value is the value set with wxDialog::SetReturnCode."
>
> See 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list