Yes it is a bug.
I have latest Tk, and I tested,
see
Re^3: Dialog box Binding issue.
Try for yourself (tab over to cancel, hit enter).
Tk::messageBox
perl -MTk -e"print tkinit->messageBox(qw, -default ok -type okcancel ,
+)"
Cancel
Tk::MsgBox
perl -MTk -e"print tkinit->MsgBox(qw, -default ok -type okcancel ,)->S
+how"
Assuming 'require Tk::MsgBox;' at -e line 1
cancel
Tk::DialogBox (expected cancel, returns ok)
perl -MTk -e"print tkinit->DialogBox(qw, -buttons , , [qw, ok cancel ,
+])->Show"
Assuming 'require Tk::DialogBox;' at -e line 1
ok
perl -MTk -e"print tkinit->DialogBox(qw, -default_button ok -buttons ,
+ , [qw, ok cancel ,])->Show"
Assuming 'require Tk::DialogBox;' at -e line 1
ok
Changing the default to cancel, then tabbing over selecting ok, and hitting enter, produces cancel, its a bug
perl -MTk -e"print tkinit->DialogBox(qw, -default_button cancel -butto
+ns , , [qw, ok cancel ,])->Show"
Wx (wxYES is 2, wxNO is 8, and it returns 8 as expected).
perl -MWx=wxYES,wxNO -e"warn wxYES;warn wxNO; die Wx::MessageBox( 1 ,
+2, wxYES|wxNO )"
2 at -e line 1.
8 at -e line 1.
8 at -e line 1.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.